Rspec 보류중인 실패한 테스트 결과
-
21-12-2019 - |
문제
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
.
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
.
왜 이것이 실패로 나열되는 이유는 무엇입니까?
해결책
rspec 3.x의 경우, 보류중인 사양이 실제로 실행되며, 패스하면 실패로 간주됩니다 (왜냐하면 RSPEC는 보류 중이어야한다고 생각합니다).
skip
대신 pending
를 사용하여 사양이 실제로 실행되지 않도록하십시오.
제휴하지 않습니다 StackOverflow