[rspec-users] [Cucumber] and rake pass command-line params

AndreXP andre.x.pretorius at gmail.com
Mon Feb 2 08:24:46 EST 2009

Hi list,

I might have not asked this correctly in previous post.. and most definitely
weren’t clear! let’s try again :)

I can’t seem to find any examples of using a rake variable in the Cucumber
task. What I want to do is run my cucumber test using cruisecontrol and
setting a variable in script to either to start Firefox or Internet Explorer
with selenium. Which leads me to the question, how do I access this
browser_type variable in my_steps.rb file?  

## Rakefile
Cucumber::Rake::Task.new do |t|
  profile = ENV['PROFILE'] || 'default'
  browser_type = ENV['BROWSER'] || '*chrome'
  t.cucumber_opts = "--profile #{profile}"
## my_steps.rb
Before do
  browser = Selenium::SeleniumDriver.new(server_host, server_port,
browser_type, root_url, time_out)

Let me guess, it’s very easy... but I am still new to the Ruby World :clap:

View this message in context: http://www.nabble.com/-Cucumber--and-rake-pass-command-line-params-tp21789574p21789574.html
Sent from the rspec-users mailing list archive at Nabble.com.

More information about the rspec-users mailing list