James Mead
2007-Apr-11 14:36 UTC
[mocha-developer] Fwd: [ mocha-Bugs-5892 ] Using a setup method in test_case_class destroys subsequent test cases
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 11-Apr-2007 15:24 Subject: [ mocha-Bugs-5892 ] Using a setup method in test_case_class destroys subsequent test cases To: noreply at rubyforge.org Bugs item #5892, was opened at 2006-09-25 07:49 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=5892&group_id=1917 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Craig Ambrose (craigambrose) Assigned to: Nobody (None) Summary: Using a setup method in test_case_class destroys subsequent test cases Initial Comment: Using a method called setup within a Test::Unit::TestCase derived class works as expected once you start using mocha and stubba, providing that you run only that test file. If you run several such files, subsequent ones throw exceptions because the Stubba method setup_stubs is no longer getting called (your test case setup method has overwritten it) and thus $stubba is nil. The error you actually see, if you are usings @your_objects.stubs().... is something like: NoMethodError: You have a nil object when you didn''t expect it! The error occurred while evaluating nil.stub ---------------------------------------------------------------------->Comment By: James Mead (jamesmead)Date: 2007-04-11 14:24 Message: I''ve just tried to reproduce this bug with both recent and old versions of Mocha, but without success. Can you let me know if you are still seeing the bug? Thanks. ---------------------------------------------------------------------- Comment By: James Mead (jamesmead) Date: 2006-11-01 11:32 Message: Sorry for the late response - I didn''t get any notification. You''d get a faster response on the developer mailing list ( http://rubyforge.org/mailman/listinfo/mocha-developer). With what version of Mocha do you see this issue? The setup/teardown mechanism has changed significantly in HEAD and I hope to do a new release soon. I suspect you won''t see the problem with the latest version. Let me know either way. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=5892&group_id=1917 -- James. http://blog.floehopper.org
James Mead
2007-Apr-12 08:25 UTC
[mocha-developer] Fwd: [ mocha-Bugs-5892 ] Using a setup method in test_case_class destroys subsequent test cases
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 12-Apr-2007 09:23 Subject: [ mocha-Bugs-5892 ] Using a setup method in test_case_class destroys subsequent test cases To: noreply at rubyforge.org Bugs item #5892, was opened at 2006-09-25 07:49 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=5892&group_id=1917 Category: None Group: None>Status: ClosedResolution: None Priority: 3 Submitted By: Craig Ambrose (craigambrose) Assigned to: Nobody (None) Summary: Using a setup method in test_case_class destroys subsequent test cases Initial Comment: Using a method called setup within a Test::Unit::TestCase derived class works as expected once you start using mocha and stubba, providing that you run only that test file. If you run several such files, subsequent ones throw exceptions because the Stubba method setup_stubs is no longer getting called (your test case setup method has overwritten it) and thus $stubba is nil. The error you actually see, if you are usings @your_objects.stubs().... is something like: NoMethodError: You have a nil object when you didn''t expect it! The error occurred while evaluating nil.stub ---------------------------------------------------------------------->Comment By: James Mead (jamesmead)Date: 2007-04-12 08:23 Message: Thanks. I''m sure you did see it. Sorry I''ve taken so long to respond. ---------------------------------------------------------------------- Comment By: Craig Ambrose (craigambrose) Date: 2007-04-12 01:38 Message: Hi James, I can''t reproduct this anymore either. I recall being pretty confident that it was a bug back when I filed it, but that was a long time ago, and I presume that it''s been fixed in a subsequent release. I''ve been using mocha quite a bit recently without any such problems. ---------------------------------------------------------------------- Comment By: James Mead (jamesmead) Date: 2007-04-11 14:24 Message: I''ve just tried to reproduce this bug with both recent and old versions of Mocha, but without success. Can you let me know if you are still seeing the bug? Thanks. ---------------------------------------------------------------------- Comment By: James Mead (jamesmead) Date: 2006-11-01 11:32 Message: Sorry for the late response - I didn''t get any notification. You''d get a faster response on the developer mailing list ( http://rubyforge.org/mailman/listinfo/mocha-developer). With what version of Mocha do you see this issue? The setup/teardown mechanism has changed significantly in HEAD and I hope to do a new release soon. I suspect you won''t see the problem with the latest version. Let me know either way. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=5892&group_id=1917 -- James. http://blog.floehopper.org