btakita / rr

RR (Double Ruby) is a test double framework that features a rich selection of double techniques and a terse syntax.
http://github.com/rr/rr
MIT License
501 stars 58 forks source link

rr invokes `to_str` on Pathname instance in the loadpath #51

Open hedgehog opened 13 years ago

hedgehog commented 13 years ago

This erro is thrown by rr, but mocha and rspec smeed not to have the trouble...

NoMethodError: undefined method to_str' for #<Pathname:/home/hedge/.rvm/lib> /home/hedge/.rvm/gems/ruby-1.9.2-p136@b3/gems/rr-1.0.2/lib/rr/method_dispatches/base_method_dispatch.rb:51:incall_original_method_missing' /home/hedge/.rvm/gems/ruby-1.9.2-p136@b3/gems/rr-1.0.2/lib/rr/method_dispatches/method_missing_dispatch.rb:35:in block in call_original_method' /home/hedge/.rvm/gems/ruby-1.9.2-p136@b3/gems/rr-1.0.2/lib/rr/injections/double_injection.rb:194:indispatch_method_delegates_to_dispatch_original_method' /home/hedge/.rvm/gems/ruby-1.9.2-p136@b3/gems/rr-1.0.2/lib/rr/method_dispatches/method_missing_dispatch.rb:34:in call_original_method' /home/hedge/.rvm/gems/ruby-1.9.2-p136@b3/gems/rr-1.0.2/lib/rr/method_dispatches/method_missing_dispatch.rb:29:incall' /home/hedge/.rvm/gems/ruby-1.9.2-p136@b3/gems/rr-1.0.2/lib/rr/injections/method_missing_injection.rb:58:in method_missing' /home/hedge/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' /home/hedge/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' /home/mv/Documents/Workspaces/b3/lib/b3/bdd/helpers.rb:86:inrvm_load'

HTH

thetamind commented 11 years ago

Another example: rr is infecting Psych when running from guard-minitest.

17 tests, 33 assertions, 1 failures, 0 errors, 1 skips
~/.gem/ruby/1.9.3/gems/rr-1.0.4/lib/rr/method_dispatches/base_method_dispatch.rb:51:in `call_original_method_missing': undefined method `to_str' for nil:NilClass (NoMethodError)
    from ~/.gem/ruby/1.9.3/gems/rr-1.0.4/lib/rr/method_dispatches/method_missing_dispatch.rb:35:in `block in call_original_method'
    from ~/.gem/ruby/1.9.3/gems/rr-1.0.4/lib/rr/injections/double_injection.rb:201:in `dispatch_method_delegates_to_dispatch_original_method'
    from ~/.gem/ruby/1.9.3/gems/rr-1.0.4/lib/rr/method_dispatches/method_missing_dispatch.rb:34:in `call_original_method'
    from ~/.gem/ruby/1.9.3/gems/rr-1.0.4/lib/rr/method_dispatches/method_missing_dispatch.rb:29:in `call'
    from ~/.gem/ruby/1.9.3/gems/rr-1.0.4/lib/rr/injections/method_missing_injection.rb:63:in `method_missing'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:127:in `==='
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:127:in `visit_Psych_Nodes_Sequence'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:20:in `accept'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:238:in `visit_Psych_Nodes_Document'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/visitors/to_ruby.rb:20:in `accept'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych/nodes/node.rb:35:in `to_ruby'
    from ~/.rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/psych.rb:128:in `load'
    from ~/.gem/ruby/1.9.3/gems/guard-1.6.2/lib/guard/notifier.rb:77:in `notifications'
    from ~/.gem/ruby/1.9.3/gems/guard-1.6.2/lib/guard/notifier.rb:176:in `notify'
    from ~/.gem/ruby/1.9.3/gems/guard-minitest-0.5.0/lib/guard/minitest/notifier.rb:33:in `notify'
    from ~/.gem/ruby/1.9.3/gems/guard-minitest-0.5.0/lib/guard/minitest/runners/version_2_runner.rb:14:in `_run_anything'
    from ~/.gem/ruby/1.9.3/gems/minitest-4.6.2/lib/minitest/unit.rb:1063:in `run_tests'
    from ~/.gem/ruby/1.9.3/gems/minitest-4.6.2/lib/minitest/unit.rb:1050:in `block in _run'
    from ~/.gem/ruby/1.9.3/gems/minitest-4.6.2/lib/minitest/unit.rb:1049:in `each'
    from ~/.gem/ruby/1.9.3/gems/minitest-4.6.2/lib/minitest/unit.rb:1049:in `_run'
    from ~/.gem/ruby/1.9.3/gems/minitest-4.6.2/lib/minitest/unit.rb:1037:in `run'
    from ~/.gem/ruby/1.9.3/gems/minitest-4.6.2/lib/minitest/unit.rb:778:in `block in autorun'
mcmire commented 11 years ago

I don't have enough details from the OP to figure out what's going on there, but I just tried setting up guard-minitest on a new project under Ruby 1.9.3-p385 using RR 1.0.4 and am not seeing any error. Can you post the test that you are trying to run?