我需要部分嘲笑:
class Post
def meth1; meth2; end
def meth2; nil; end
end
real_model = Post.new
mock_model = SomeMock.new real_model
mock_model.expect :meth1, true
mock_model.validate
mock_model.verify # should return true if #meth2 has worked and false otherwise
有 SimpleMock ( https://github.com/tatey/simple_mock ) 但似乎它不接受部分模拟: https://github.com/tatey/simple_mock/issues/3
你能帮助我吗?谢谢