Using Mocha to mock an object

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?

Thanks,
Joe

On 10/20/06, Joe Van D. [email protected] wrote:

of Order.export_unshipped_orders. How can I do that?
Got it:

Order.stubs(:export_unshipped_orders).returns("what's going on?")

Easy enough!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs