[mocha-developer] mocking missing methods
jamesmead44 at gmail.com
Wed Apr 25 18:03:34 EDT 2007
Hmm. Interesting. I think I find my examples more readable/logical
than the ones you give, but it's helpful to have someone else's take
on the matter.
Also wouldn't there be difficulties implementing the
responds_like(Sheep.class) version, in that the class() method on any
class object will return Class e.g. Sheep.class # => Class and
Goat.class # => Class.
An example I forgot to mention...
sheep = mock()
So responds_like(responder) just needs a responder that responds to
respond_to?() if you see what I mean. The instance_of() method would
be provided so you didn't have to construct an instance of an object
just so you could mock it.
More information about the mocha-developer