1
다음 모듈이 있습니다.RSpec 테스트 모듈 방법/
module A
module B
def self.method_b(value)
#code
end
end
end
및
module A
module C
def self.method_c(value)
A::B.method_b(value)
end
end
end
방법이 모듈을 테스트? 스텁 self.method_b 만드는 법?
spec_helper.rb
RSpec.configure do |config|
config.mock_with :mocha
end
감사합니다.
의':: B.stub (: method_b) .and_return는 ("무엇이든")' – d11wtq
'NoMethodError하십시오 :: B에 대한 정의되지 않은 메서드 '그루터기'Module' – Mike
버그처럼 보인다 나에게 RSpec. '# stub '은 모든 객체에서 사용할 수 있어야합니다 : - \ – d11wtq