[mocha-developer] .class call to the mock object (or any existing methods)
Kurman Karabukaev
kkarabuk at thoughtworks.com
Wed Nov 22 17:12:45 EST 2006
Hi
I run into problem trying to set expectations for the mockobject.class
method, I had to undefine a method before I could set some expectation. Is
there any better way of doing it?
object = mock()
....
klass = class <<object; self; end
klass.send(:undef_method, "class") # I had to do this because Mocha
utilizes "method_missing(symbol, *arguments, &block) " method.
object.expects(:class).returns(SomeClass)
...
And thanks for such a nice library.
------------------------------
Kurman Karabukaev
Application Developer
ThoughtWorks Inc.
(312) 282 0231
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mocha-developer/attachments/20061122/fa8a9d14/attachment.html
More information about the mocha-developer
mailing list