rspec at showcase60.com
2007-Dec-13 17:36 UTC
[rspec-users] RSpec and Mock Tutorial/Cheatsheet
I wrote a simple summary of Mocks with RSpec as an answer to a discussion on our local Ruby users group. I was wondering if people here could review it, adding comments for any corrections or other important ideas regarding mocks and RSpec. You can find the article here: http://blog.showcase60.com/2007/12/13/rspec-mocks Thanks
On Dec 13, 2007, at 12:36 PM, rspec at showcase60.com wrote:> I wrote a simple summary of Mocks with RSpec as an answer to a > discussion on our local Ruby users group. I was wondering if people > here could review it, adding comments for any corrections or other > important ideas regarding mocks and RSpec. You can find the article > here: http://blog.showcase60.com/2007/12/13/rspec-mocks > > Thankshey - Thanks for the mention! Just wanted to clarify this point: "Mocha is one of those alternatives ...The benefit of Mocha is that you can mock and stub methods on real classes and instances (not just your mock models). So, if you?re specing class Foo, and you want to assume that the method bar is working, you can just stub that out, and focus on the part of the class that you?re creating at the moment." Just to let you know, there is nothing stopping you from doing this with rspec''s mock/stub framework. Scott