-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Trying to fix mocha upgrade failures #5907
Conversation
/cc @tenderlove |
This is a reasonable workaround for now, but this should probably be resolved with Mocha. It needs to alias |
Interesting idea. I'm going to see if that's possible. |
I'll take a look. On Monday, April 23, 2012, José Valim wrote:
Aaron Patterson |
I already send a pull request in mocha. https://github.com/floehopper/mocha/pull/77 |
@jeremy you're right. Can we just not upgrade mocha until this is fixed upstream? |
By all means :) This is in our own Gemfile after all. Really loose requirement. |
Yep, letz lock it! :D Sent from my iPhone On Apr 23, 2012, at 7:45 PM, Jeremy Kemperreply@reply.github.com wrote:
|
Yes I think lets lock it for now. and later can be upgraded once mocha upgrade. I will do a PR. |
While I think the suggested solution (i.e. the change to Mocha) is the best pragmatic option, philosophically I think it implies that Mocha should not rely on any other core Ruby methods in classes like It's not impossible that other libraries or applications may also expect Anyway, I'll attend to the Mocha pull request and release a new version. |
Mocha v0.11.2 is now available including a slightly tweaked version of the pull request. Hopefully this will do the trick. |
Closing this as 0.11.2 is out. thanks guys :-) |
= 0.11.3 * Fix for #78 i.e. alias Object#method as Object#_method, not Object#__method__ which already exists as another Ruby method. = 0.11.2 * Rails has a Request class which defines its own #method method. This broke the new mechanism for stubbing a method. This release includes a slightly modified version of fix #77 provided by @sikachu. See rails/rails#5907 for further info. = 0.11.1 () * In Ruby 1.8.7 methods accepting a block parameter were incorrectly restored without the block parameter after being stubbed. Fix for #76. = 0.11.0 (fa601c89a7f5314dc3d258391a99c6a9e25cefb3) * Store original method when stubbing rather than using alias_method. This fixes #41, #47, #74 and all tests now pass on both Ruby 1.8.7 and 1.9.3. * Attempting to stub a method on a frozen object should fail fast. See #68. * Prevent stubbing a method on nil by default. See #68. * Generate documentation using YARD instead of Rdoc - removes dependency on Coderay. * Publish documentation on Github pages instead of Rubyforge - uses rake task written by @tomafro. * Remove agiledox which has outlived it's usefulness. * Removed trailing whitespace throughout codebase. * Add documentation for Mock#unstub. * Improve documentation for ObjectMethods. * Provide a way to run multiple tests within a single acceptance test method.
= 0.11.3 * Fix for #78 i.e. alias Object#method as Object#_method, not Object#__method__ which already exists as another Ruby method. = 0.11.2 * Rails has a Request class which defines its own #method method. This broke the new mechanism for stubbing a method. This release includes a slightly modified version of fix #77 provided by @sikachu. See rails/rails#5907 for further info. = 0.11.1 () * In Ruby 1.8.7 methods accepting a block parameter were incorrectly restored without the block parameter after being stubbed. Fix for #76. = 0.11.0 (fa601c89a7f5314dc3d258391a99c6a9e25cefb3) * Store original method when stubbing rather than using alias_method. This fixes #41, #47, #74 and all tests now pass on both Ruby 1.8.7 and 1.9.3. * Attempting to stub a method on a frozen object should fail fast. See #68. * Prevent stubbing a method on nil by default. See #68. * Generate documentation using YARD instead of Rdoc - removes dependency on Coderay. * Publish documentation on Github pages instead of Rubyforge - uses rake task written by @tomafro. * Remove agiledox which has outlived it's usefulness. * Removed trailing whitespace throughout codebase. * Add documentation for Mock#unstub. * Improve documentation for ObjectMethods. * Provide a way to run multiple tests within a single acceptance test method.
So Mocha got an update to new version and our actionpack started failing after that
So after research i found that mocha internally doing some stuff with
We have one function
in our request model which is not having any argument.This is why we are getting above error that mocha is giving 1 argument for stubbee
here you can found that call https://github.com/floehopper/mocha/compare/24314c2e77...master#L68R39
I tried to fix this in test itself as we don't want to change much things.
Please let me know your suggestions. I will make changes according to that.