Ruby on Rails:如何在rake文件中运行Cucumber任务?

时间:2010-06-24 18:57:16

标签: ruby-on-rails

目前,我有这个

Rake :: Task ['FEATURE = features / Authentication.feature cucumber']。invoke

但是id不起作用..说

Don't know how to build task 'FEATURE=features/Authentication.feature cucumber'

但是当我做的时候

rake FEATURE=features/Authentication.feature cucumber

有效...... = \

1 个答案:

答案 0 :(得分:1)

在新的rake文件(lib / tasks)中:

require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'

namespace :cucumber do

Cucumber::Rake::Task.new(:authentication2) do |t|
  t.cucumber_opts = "features/Authentication.feature"
end


Cucumber::Rake::Task.new(:preview_all) do |t|
  t.cucumber_opts = "features/Preview.feature features/PreviewButton.feature"
end

end