I'm using MiniTest 2.12.1 (the latest version of the stock testing framework shipped with Ruby >= 1.9) and I can't figure out how to mock a class method with it, the same way it's possible with the likes of Mocha, for example:
product = Product.new
Product.expects(:find).with(1).returns(product)
assert_equal product, Product.find(1)
I've been dabbling the Internet for days and I'm still to find a reasonable answer to this. Please help?