On Tue, Jul 23, 2013 at 7:22 AM, George Mendoza <[email protected]> wrote:

> 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
> :)
>

I cloned the repo, checked out the branch, ran rspec and got the following
error:

undefined method `add_method_signature_with_current_double' for
#<VerifiedDouble::RecordedMethodSignatureRegistry:0x007f9cdab73f58>

Then I grepped through the code and I don't see
any add_method_signature_with_current_double method, so the error seems
legit to me. I might be missing something (like a `method_missing` designed
to handle this) but maybe that helps point you in the right direction.

HTH,
David

-- 
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/CAKw-oWQvDTnxtWJJgypPPLUF%2BmL-JLYPwdXinCNZ2oGFdtrKyg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to