[mocha-developer] expects with returns that returns the return value of the actual method

Steve Eichert steve.eichert at gmail.com
Thu Jun 21 08:09:39 EDT 2007

In my specific example I want to use the real result because the real result
being used is already a "fake" object that is returning canned results
depending on the inputs.  I'm trying to test some logic that's making use of
active_merchant, and am using their "bogus" gateway that returns
success/failures depending on predefined input.  I can definitely go the
route you mentioned and record a sample result, I was just hoping I could
re-use the already implemented logic.  I actually think that breaking my
tests apart to test more specific things per test will help as well.


On 6/21/07, James Mead <jamesmead44 at gmail.com> wrote:
> While it would be technically possible, Mocha doesn't support this. I
> doubt
> it ever will because what you describe is not really what mocking is all
> about.
> Why do you want to get the real result? Can you not record a sample result
> and then use this as a canned result in the test?
> --
> James.
> http://blog.floehopper.org
> _______________________________________________
> mocha-developer mailing list
> mocha-developer at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mocha-developer

More information about the mocha-developer mailing list