Greg Borenstein
2006-Oct-12 18:33 UTC
[mocha-developer] did something in revision 68 break stubs?
Hi, I''ve been a happy user of Mocha for a while now. My current project is by far the most complicated I''ve ever worked on and Mocha has made testing it much easier than it would otherwise be. So, I was highly disturbed to come in this morning, run svn up and find that something in today''s update broke lots of my tests. I use Mocha as a Rails plugin under svn:externals and when I hit svn up, I was updated to revision 68. Then when I ran my morning''s ritual full test run all the tests that call ''stubs'' threw erros like this one: 7) Error: test_find_venue_id_returns_nil(UpcomingMessageTest): NoMethodError: undefined method `stubs'' for #<UpcomingMessage:0x2a983cb2e0> /home/greg/projects/mercury/config/../vendor/rails/activerecord/lib/active_record/base.rb:1845:in `method_missing'' test/unit/upcoming_message_test.rb:116:in `test_find_venue_id_returns_nil'' /home/greg/projects/mercury/config/../vendor/plugins/mocha/lib/mocha/test_case_adapter.rb:19:in `run'' The problem seems to be occuring in lib/mocha/test_case_adapter.rb which was updated by revision 68. Wondering if anyone else is seeing this problem and if not where I should start to look in my code for the incompatibility. I''ve looked and looked to see if something I changed recenly could possibly have caused this problem (even canceled posting to this list once because I thought I''d found it), but I can''t see what I could be doing wrong. Thanks for the help, Greg http://www.urbanhonking.com/ideasfordozens http://www.virtuous.com
James Mead
2006-Oct-12 21:16 UTC
[mocha-developer] did something in revision 68 break stubs?
On 12/10/06, Greg Borenstein <greg at virtuous.com> wrote:> > I''ve been a happy user of Mocha for a while now. My current project is > by far the most complicated I''ve ever worked on and Mocha has made > testing it much easier than it would otherwise be. > > So, I was highly disturbed to come in this morning, run svn up and find > that something in today''s update broke lots of my tests. I use Mocha as > a Rails plugin under svn:externals and when I hit svn up, I was updated > to revision 68. Then when I ran my morning''s ritual full test run all > the tests that call ''stubs'' threw erros like this one: > > 7) Error: > test_find_venue_id_returns_nil(UpcomingMessageTest): > NoMethodError: undefined method `stubs'' for > #<UpcomingMessage:0x2a983cb2e0> > > > /home/greg/projects/mercury/config/../vendor/rails/activerecord/lib/active_record/base.rb:1845:in > `method_missing'' > test/unit/upcoming_message_test.rb:116:in > `test_find_venue_id_returns_nil'' > > > /home/greg/projects/mercury/config/../vendor/plugins/mocha/lib/mocha/test_case_adapter.rb:19:in > `run'' > > The problem seems to be occuring in lib/mocha/test_case_adapter.rb which > was updated by revision 68. > > Wondering if anyone else is seeing this problem and if not where I > should start to look in my code for the incompatibility. I''ve looked and > looked to see if something I changed recenly could possibly have caused > this problem (even canceled posting to this list once because I thought > I''d found it), but I can''t see what I could be doing wrong. >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. 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 (http://piston.rubyforge.org/) to have more control over plugin versions and so hadn''t noticed the bug. 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! I hope that helps. -- James. http://blog.floehopper.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mocha-developer/attachments/20061012/e47fcce1/attachment.html
Maybe Matching Threads
- Functional Test has error when testing controller updates_attribute of its parrent.
- problem with using any_instance
- Mocha 0.4.0 Hates My App
- Rails AR/Oracle Unit Test: [7769] failed (getting worse)
- Rails AR/SQLServer Unit Test: [6912] failed (but getting better)