【发布时间】:2018-02-22 03:47:56
【问题描述】:
我正在将 Rspec Retry gem 应用到我的项目中。我已将重试代码添加到 spec_helper.rb 中,并且正在使用此方法对其进行测试:
it 'should randomly succeed', :retry => 3 do
expect(rand(23)).to eq(1)
end
但是,我无法让重试真正重新运行该方法。我正在努力弄清楚为什么它不会重试。这是控制台输出。
My console outputs the following:
C:\RSpecRetry>rspec spec/support/raise_error.rb
C:/RSpecRetry/spec/spec_helper.rb:100: warning: already initialized constant CONTINUE_SPEC
C:/RSpecRetry/spec/spec_helper.rb:95: warning: previous definition of CONTINUE_SPEC was here
1st Try error in ./spec/support/raise_error.rb:8:
expected: 1
got: 17
(compared using ==)
RSpec::Retry: 2nd try ./spec/support/raise_error.rb:8
.
Finished in 1.07 seconds (files took 1.89 seconds to load)
1 example, 0 failures
【问题讨论】:
标签: rspec