From: Joe Van Dyk Date: 2006-10-21T08:03:09+09:00 Subject: Re: Using Mocha to mock an object On 10/20/06, Joe Van Dyk wrote: > Hi, > > I have: > class Order > def self.export_unshipped_orders > # returns a string > end > end > > I want to use Mocha (http://mocha.rubyforge.org/) to fake the return > of Order.export_unshipped_orders. How can I do that? Got it: Order.stubs(:export_unshipped_orders).returns("what's going on?") Easy enough!