Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[*foo] idiom fails on ruby 1.9.2 with rr stubs/mocks #61

Open
trampoline opened this issue Jun 2, 2011 · 1 comment
Open

[*foo] idiom fails on ruby 1.9.2 with rr stubs/mocks #61

trampoline opened this issue Jun 2, 2011 · 1 comment
Labels
Milestone

Comments

@trampoline
Copy link

using [*foo] idiom to expand a singular-or-array value into an array fails when foo value has a rr stub or mock method

 require 'rr'
 include RR::Adapters::RRMethods
 stub(o).foo{"foo"}
 [*o]

 RR::Errors::DoubleNotFoundError: On subject #<Object:0x00000100860e10>
 ...
@trampoline
Copy link
Author

oops : missed the crucial lines of backtrace :

 RR::Errors::DoubleNotFoundError: On subject #<Object:0x00000100860e10>,
 unexpected method invocation:
   to_a()
 expected invocations:

    from /Users/mccraig/.rvm/gems/ruby-1.9.2-p180@general/gems/rr-1.0.2/lib/rr/method_dispatches/base_method_dispatch.rb:76:in `double_not_found_error'
    from /Users/mccraig/.rvm/gems/ruby-1.9.2-p180@general/gems/rr-1.0.2/lib/rr/method_dispatches/method_missing_dispatch.rb:26:in `call'
    from /Users/mccraig/.rvm/gems/ruby-1.9.2-p180@general/gems/rr-1.0.2/lib/rr/injections/method_missing_injection.rb:58:in `method_missing'
    from /Users/mccraig/.rvm/gems/ruby-1.9.2-p180@general/gems/rr-1.0.2/lib/rr/injections/double_injection.rb:129:in `to_a'
    from (irb):10
    from /Users/mccraig/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant