[rspec-users] Using cucumber profiles with rake task

Francisco Trindade lists at ruby-forum.com
Tue Feb 10 10:27:16 EST 2009


Im trying to set up an environment where I am able to run different
cucumber profiles (webrat/selenium) in the same project.

I did manage to make them work using the cucumber command, so this
command works:
cucumber -p selenium features/done/items_selenium.feature

The problem I have is when I try to do the same thing using the rake
task. I followed the advice given on this thread
(http://www.ruby-forum.com/topic/177404) and changed the rake task to
what is described below, but apparently the rake task does not consider
if you are passing a profile or not, and keeps requiring every file from
the features directory, generating some conflicts.

Cucumber::Rake::Task.new(:features) do |t|
  profile = ENV['PROFILE'] || 'default'
  t.cucumber_opts = "-p #{profile} --format progress"

I did manage to make it work using this parameters in the rake task:

Cucumber::Rake::Task.new(:features) do |t|
  t.cucumber_opts = "--format progress"
  t.step_pattern =
  t.feature_pattern = "features/**/*_webrat.feature"

but Im wondering if there is not a better way of doing this, reusing the
elements from the cucumber profile.

Am I missing something?

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list