2010-08-30 24 views
0

使用TSPEC 2我要动态创建一个rake任务来运行,我们用来做在RSpec的1以下:如何使用Rspec 2创建RSpec任务?

Spec::Rake::SpecTask.new(:client) do |t| 
    t.spec_files = FileList['spec/units/client/**/*_spec.rb'] 
    t.spec_opts = spec_opts 
end 

但现在规格::耙:: SpecTask被替换下场,有什么建议?

问候

回答

1

任务名称现在是Rspec::Core::RakeTask任务,如

Rspec::Core::RakeTask.new(:client) do |t| 
    t.pattern = ".spec/units/client/**/*_spec.rb" 
    t.spec_opts = spec_opts 
end