[mocha-developer] Fwd: [ mocha-Bugs-6416 ] Mock objects shouldn't define #to_s

James Mead jamesmead44 at gmail.com
Wed Apr 11 10:36:16 EDT 2007


---------- 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


More information about the mocha-developer mailing list