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

Already on GitHub? Sign in to your account

Wrong number of arguments for respond_to? #282

Closed
r38y opened this Issue Dec 13, 2010 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

r38y commented Dec 13, 2010

I am running into an error deep down in Rails when I use mock_model before trying to create an instance of a model. Here is the first part of the backtrace:

  1. WeighInNotifier.skipped_weigh_in_friend(friend, user, weigh_in) should have a reply-to of the user's email
    Failure/Error: @user = Factory(:user)
    wrong number of arguments (2 for 1)

    /Users/r38y/.rvm/gems/ree-1.8.7-2010.02@lioli/gems/activesupport-3.0.3/lib/active_support/time_with_zone.rb:311:in `respond_to?'

    /Users/r38y/.rvm/gems/ree-1.8.7-2010.02@lioli/gems/activesupport-3.0.3/lib/active_support/time_with_zone.rb:311:in`respond_to?'

I tracked it down to the following line:

https://github.com/rspec/rspec-rails/blob/master/lib/rspec/rails/mocks.rb#L103

I copied this code into my app and changed that to take two arguments and it almost works. The test hangs instead of failing.

I'm happy to fix this if it needs fixing, I just wanted some guidance about it. Thoughts?

Owner

dchelimsky commented Dec 13, 2010

respond_to?(method, include_private=false)

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment