Hello everybody,
I'm trying to update my rspec extension gem (
https://github.com/gsmendoza/verified_double) to the new expect syntax of rspec-mocks. I guessed that I can do this by creating a thin wrapper over the expect, receive, and allow methods of RSpec::Mocks::Syntax:
module VerifiedDouble
module RSpecMocksSyntaxOverrides
def expect(*args)
VerifiedDouble.registry.current_double = args[0]
super(*args)
end
def receive(*args)
VerifiedDouble.registry.add_method_signature_with_current_double(args[0])
super(*args).tap {|result| result.extend(VerifiedDouble::CanRecordInteractions) }
end
end
end
The
test for overridden expect method passes, but the test for the receive method fails. If I rename my receive method to something else like better_receive, then the test suite can pick it up.
If you can point me where or how to integrate the VerifiedDouble::RSpecMocksSyntaxOverrides module, that would be a big help :)
Thank you very much,
George Mendoza
Philippines