[mocha-developer] advice on new failures with 0.5.0

Justin Perkins justin at spiceworks.com
Tue Jun 12 14:05:56 EDT 2007

Hi all,
We just updated to the latest version of Mocha and now we're seeing a  
lot of odd test failures. If this isn't the appropriate place for a  
question like this, please let me know.

Say I have code like this in a controller:


And I mock it like this:


This would work fine with Mocha 0.4.0, but with 0.5.0 it looks like  
Mocha is differentiating between a method call with parenthesis to  
one without parenthesis. I don't really understand how this could  
happen, nor the logic in why parenthesis should be required for an  
empty parameter list, so if somebody could explain it to me that'd be  

For reference, this is the failure we're now seeing:

#<Mock:0x3308718>.toggle_notification!() - expected calls: 0, actual  
calls: 1
Similar expectations:

The release notes at the API site (http://mocha.rubyforge.org/files/ 
RELEASE.html) have not been updated, so I wasn't able to determine  
the reason behind this change on my own.

Thanks for Mocha, I love it, but for now am sticking with the 0.4.0  


More information about the mocha-developer mailing list