有没有办法让 RSpec 在引发异常后继续处理规范?
这是我的规范任务的样子:
SPEC_PATTERN = "spec/**/*_spec.rb"
Spec::Rake::SpecTask.new() do |t|
t.spec_files = FileList[SPEC_PATTERN]
t.verbose = true
t.spec_opts = ["--format", "html:spec/spec_report.html"]
t.fail_on_error = false
t.rcov = true
t.rcov_dir = 'coverage'
t.rcov_opts = ['--exclude', 'spec']
end
最佳答案
使用“should raise_exception”怎么样?
http://rspec.rubyforge.org/rspec/1.3.0/classes/Spec/Matchers.html#M000183
关于ruby-on-rails - RSpec 异常后继续,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2350069/