James Mead
2007-Apr-11 14:36 UTC
[mocha-developer] Fwd: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 11-Apr-2007 15:07 Subject: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s To: noreply at rubyforge.org Bugs item #6416, was opened at 2006-10-31 15:34 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=6416&group_id=1917 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: James Adam (lazyatom) Assigned to: Nobody (None) Summary: Mock objects shouldn''t define #to_s Initial Comment: Creating a mock object which expects the #to_s method is impossible at present, and results in an unattainable expectation: mock(:whatever, :to_s => ''hi'') puts mock.to_s # ==> #<Mocha::Mock:0x244cb60> It''s almost certainly desirable to be able to mock the #to_s method, so the inheritted #to_s in Mocha::Mock should either be removed, or some explicit behaviour added which can handle setting expectations for methods already present on that object. ---------------------------------------------------------------------->Comment By: James Mead (jamesmead)Date: 2007-04-11 14:07 Message: Sorry for the delayed response. I think this was fixed in revision 86 which should have made it into release 0.4. Can you let me know if this is still broken? Thanks. ---------------------------------------------------------------------- Comment By: James Mead (jamesmead) Date: 2006-11-01 11:06 Message: This is a known issue. I hope to commit a fix soon. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=6416&group_id=1917 -- James. http://blog.floehopper.org
Maybe Matching Threads
- Fwd: [ mocha-Bugs-16523 ] Ruby 1.9 gives warning
- Fwd: [ mocha-Bugs-5892 ] Using a setup method in test_case_class destroys subsequent test cases
- Fwd: [ mocha-Bugs-11885 ] never doesn''t work with stub_everything
- Fwd: [ mocha-Bugs-8687 ] Block''s return value is dropped on stubbed yielding methods.
- Fwd: [ mocha-Bugs-7834 ] infinte_range.rb makes incorrect assumption about to_f