ExampleMethods는 : http://rubydoc.info/github/rspec/rspec-mocks/RSpec/Mocks/ExampleMethods 이에 따라정의되지 않은 방법 instance_double : 나는이 같은 테스트 케이스를
undefined method 'instance_double' for #<Rspec::Core::ExampleGroup::Nested_1::Nested_8::Nested_3:0x007f0788b98778>
: 나는 RSpec을 실행하면
describe WorkCardsController do
it "something" do
work_card = instance_double(WorkCard, {:started?=>true})
#some more code
end
end
, 오류가 발생합니다 메소드가 존재합니다. 그래서 내가 직접 액세스하려고 :
describe WorkCardsController do
it "something" do
work_card = RSpec::Mocks::ExampleMethods::instance_double(WorkCard, {:started?=>true})
#some more code
end
end
그리고 나는 아주 놀라운 오류가있어 : 나는 위의 링크 된 문서에 반하는
undefined method 'instance_double' for Rspec::Mocks::ExampleMEthods:Module
합니다.
무엇이 누락 되었습니까? 코드에 include
그것을 시도
Mix this in to your test context (such as a test framework base class) to use rspec-mocks with your test framework.
: 당신이 가리키는 문서에서
있습니까? 이 순간의 보석 버전은 2.14입니다. 따라서 github로 설치하지 않았다면 그 방법은 존재하지 않습니다. – Iazel