2
在ROR应用程序中用于模拟,存根的最佳库是什么?Ruby on rails:模拟和存根库
在ROR应用程序中用于模拟,存根的最佳库是什么?Ruby on rails:模拟和存根库
Mocha是一个相当不错的模拟和红宝石存根库。
def test_mocking_a_class_method
product = Product.new
Product.expects(:find).with(1).returns(product)
assert_equal product, Product.find(1)
end
什么是“钢轨上的雷比”? – Sevki 2010-10-10 09:13:24
纠正... :-) – 2010-10-10 09:14:10