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 this: 18) Error: test_created_at(EntityTest): 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'' /opt/local/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/ 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. Cheers, Blake !DSPAM:389,4604195f6891618813547!
Sorry to hear that. Thanks for the stack-trace, but there''s not really enough information in your email - can you give us the code in the failing test and the code under test? The fact it only fails when run on its own suggests it may be relying on another test to run first. -- James. http://blog.floehopper.org
It actually passes when run on its own or when the individual test file is run, but fails during the complete suite. I''ll follow up with code shortly... On Mar 25, 2007, at 11:09 AM, James Mead wrote:> Sorry to hear that. Thanks for the stack-trace, but there''s not really > enough information in your email - can you give us the code in the > failing > test and the code under test? The fact it only fails when run on > its own > suggests it may be relying on another test to run first. > > -- > James. > http://blog.floehopper.org > _______________________________________________ > mocha-developer mailing list > mocha-developer at rubyforge.org > http://rubyforge.org/mailman/listinfo/mocha-developer > > > >!DSPAM:389,4606b0e7278811420326529!
Reasonably Related Threads
- did something in revision 68 break stubs?
- Rails AR/SQLServer Unit Test: [6912] failed (but getting better)
- Rails AR/Oracle Unit Test: [7769] failed (getting worse)
- SslRequirements plugin and mocha
- removing Mocha; 'spec spec' fails but the specific model file passes