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:
# https://github.com/gsmendoza/verified_double/blob/7-convert-from-should_receive-to-expect-syntax/lib/verified_double/rspec_mocks_syntax_overrides.rb 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<https://github.com/gsmendoza/verified_double/blob/7-convert-from-should_receive-to-expect-syntax/spec/verified_double/rspec_mocks_syntax_overrides_spec.rb> 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 -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/3d143f97-0237-4c08-8368-8658a8fcc2dd%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
