Eri*_*cis 12 ruby rspec ruby-on-rails rspec3
it 'should be an array and not be empty' do
pending
expect(a.class).to be(Array)
expect(a.empty?).to be(false)
expect(a.first.class).to be(ExampleClass)
end
Run Code Online (Sandbox Code Playgroud)
当我运行rspec时:
Failures:
1) should be an array and not be empty FIXED
Expected pending 'No reason given' to fail. No Error was raised.
# ./spec/example_spec.rb:19
Run Code Online (Sandbox Code Playgroud)
任何想法为什么这被列为失败?
Dyl*_*kow 37
从Rspec 3.x开始,挂起的规格实际上已经运行,如果它们通过,则认为它是失败的(因为如果它通过,那么Rspec认为它不应该是未决的).
您可以使用skip
而不是pending
确保您的规范实际上不运行.
更多信息:http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#changes_to__semantics_and_introduction_of_
归档时间: |
|
查看次数: |
4377 次 |
最近记录: |