Hi!
What the best library to use for mock, stub... in ROR application?
Hi!
What the best library to use for mock, stub... in ROR application?
Mocha is a quite nice mocking and stubbing library for Ruby.
Have a look at the example usages.
def test_mocking_a_class_method
product = Product.new
Product.expects(:find).with(1).returns(product)
assert_equal product, Product.find(1)
end