【发布时间】:2010-05-28 02:45:05
【问题描述】:
Rake 允许使用以下语法:
task :my_task, :arg1, :arg2 do |t, args|
puts "Args were: #{args}"
end
我希望能够做到这一点,但使用 RSpecs SpecTask。
以下不幸失败:
desc "Run example with argument"
SpecTask.new('my_task'), :datafile do |t, args|
t.spec_files = FileList['*_spec.rb -datafile=#{args}']
t.spec_opts = ["-c -f specdoc"]
end
是否可以通过 SpecTask 实现这一点,或者是否有替代方法?
【问题讨论】: