Skip to content

Wrong number of arguments for respond_to? #282

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

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

Wrong number of arguments for respond_to? #282

r38y opened this issue Dec 13, 2010 · 1 comment

Comments

@r38y
Copy link
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?

@dchelimsky
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants