[mocha-developer] Mocha 0.4.0 Hates My App

Blake Watters blake at near-time.com
Fri Mar 23 14:17:10 EDT 2007

Hi all -

I've recently made the leap from FlexMock to Mocha for mocks within  
my app. Today I decided to upgrade from Mocha 0.3.2 to Mocha 0.4.0.  
So I updated the gem, started rake and went to get some coffee. I  
came back 5 mins later and my units (which were clean) are now  
reporting 97 failures (!!!). Every failure reports a callstack like  

18) Error:
NoMethodError: You have a nil object when you didn't expect it!
The error occured while evaluating nil.created_at
     ./test/unit/entity_test.rb:199:in `test_created_at'
test_case_adapter.rb:19:in `run'

Interestingly, this method runs fine when run alone, but not in the  
test:units suite or when the entire EntityTest is run. It relies on a  
@entity from the setup method, which seems to be executing.

My app is fairly large, with a number of Gem and plugin dependencies.  
Has anyone else had a similar problem or have any ideas? So far I  
haven't made any headway on finding the source.



More information about the mocha-developer mailing list