Forum: RSpec [Cucumber] Passing a variable from rake to steps file

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C95b0c72d59859bbab5d14f6f2332c1b?d=identicon&s=25 Andre Pretorius (andrexp)
on 2009-01-30 17:25
(Received via mailing list)
Can anybody tell me how to pass a variable from the rake command to my
steps
file using cucumber? I have the following in my Rakefile:

## Rakefile
Cucumber::Rake::Task.new do |t|
  profile = ENV['PROFILE'] || 'default'
  browser_type = ENV['BROWSER'] || '*chrome'
  t.cucumber_opts = "--profile #{profile}"
end

I would like to have access to the "browser_type" variable in my "Before
do"
in my_steps.rb file.

## my_steps.rb
Before do
  $browser = Selenium::SeleniumDriver.new($server_host, $server_port,
"browser_type", $root_url, $time_out)
end

Thanks for the help.
--
View this message in context:
http://www.nabble.com/-Cucumber--Passing-a-variabl...
Sent from the rspec-users mailing list archive at Nabble.com.
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-02-10 23:30
(Received via mailing list)
dude. have you lost your memory? didn't we have this conversation a week
ago?

http://www.nabble.com/-Cucumber--and-rake-pass-com...

aslak
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-02-11 00:47
(Received via mailing list)
On Tue, Feb 10, 2009 at 2:42 PM, aslak hellesoy
<aslak.hellesoy@gmail.com> wrote:
> dude. have you lost your memory? didn't we have this conversation a week ago?
>
> http://www.nabble.com/-Cucumber--and-rake-pass-com...

Sorry - my fault - was going back through some email that was pending
moderation :) Note the date is Jan 30.

Cheers,
David
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-02-11 02:42
(Received via mailing list)
On Tue, Feb 10, 2009 at 11:30 PM, David Chelimsky <dchelimsky@gmail.com>
wrote:
> On Tue, Feb 10, 2009 at 2:42 PM, aslak hellesoy
> <aslak.hellesoy@gmail.com> wrote:
>> dude. have you lost your memory? didn't we have this conversation a week ago?
>>
>> http://www.nabble.com/-Cucumber--and-rake-pass-com...
>
> Sorry - my fault - was going back through some email that was pending
> moderation :) Note the date is Jan 30.
>

Haha. Andre, please disregard my comment.

Aslak
This topic is locked and can not be replied to.