문제

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를 사용하여 사양이 실제로 실행되지 않도록하십시오.

자세한 정보 : http://myronmars.to/n / dev-blog / 2014 / 05 / 주목할만한 - in-in-in-in-in-in-in-rspec-3 # change_to__semantics_and_introduction_of_

다른 팁

여기 당신의 단서가 있습니다 :

should be an array and not be empty FIXED
.

통과하는 것들이 보류중인 테스트가 실패하게됩니다.예제 [1], [2].

에 대한 문서가 확인하십시오.

  1. rspec 2
  2. rspec 3
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top