On 12/10/06, <b class="gmail_sendername">Greg Borenstein</b> &lt;<a href="mailto:greg@virtuous.com">greg@virtuous.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've been a happy user of Mocha for a while now. My current project is<br>by far the most complicated I've ever worked on and Mocha has made<br>testing it much easier than it would otherwise be.<br><br>So, I was highly disturbed to come in this morning, run svn up and find
<br>that something in today's update broke lots of my tests. I use Mocha as<br>a Rails plugin under svn:externals and when I hit svn up, I was updated<br>to revision 68. Then when I ran my morning's ritual full test run all
<br>the tests that call 'stubs' threw erros like this one:<br><br>&nbsp;&nbsp;7) Error:<br>test_find_venue_id_returns_nil(UpcomingMessageTest):<br>NoMethodError: undefined method `stubs' for #&lt;UpcomingMessage:0x2a983cb2e0&gt;<br>
<br>/home/greg/projects/mercury/config/../vendor/rails/activerecord/lib/active_record/base.rb:1845:in<br>`method_missing'<br>&nbsp;&nbsp;&nbsp;&nbsp;test/unit/upcoming_message_test.rb:116:in<br>`test_find_venue_id_returns_nil'<br><br>/home/greg/projects/mercury/config/../vendor/plugins/mocha/lib/mocha/test_case_adapter.rb:19:in
<br>`run'<br><br>The problem seems to be occuring in lib/mocha/test_case_adapter.rb which<br>was updated by revision 68.<br><br>Wondering if anyone else is seeing this problem and if not where I<br>should start to look in my code for the incompatibility. I've looked and
<br>looked to see if something I changed recenly&nbsp;&nbsp;could possibly have caused<br>this problem (even canceled posting to this list once because I thought<br>I'd found it), but I can't see what I could be doing wrong.<br></blockquote>
</div><br>I'm glad you've been finding Mocha useful. You were right about the bug - it should be fixed in revision 70 (latest HEAD). Sorry.<br><br>I have to confess that I have been making relatively large changes to Mocha recently in HEAD. I had forgotten that the default for Rails plugins with svn:externals is to use HEAD - we use Piston (
<a href="http://piston.rubyforge.org/">http://piston.rubyforge.org/</a>) to have more control over plugin versions and so hadn't noticed the bug.<br><br>The bug was a typo in a require statement. Mocha's tests were passing because other tests had already loaded the missing file. I've been meaning to add a mini Rails project to test the plugin more extensively - I guess I should make it a higher priority!
<br><br>I hope that helps.<br clear="all"><br>-- <br>James.<br><a href="http://blog.floehopper.org">http://blog.floehopper.org</a>