small medium large xlarge

Back to: All Forums  PragPub
Gravatar_pragsmall
09 May 2010, 20:40
James Mead (3 posts)

There are some significant errors in this article…

The syntax of the first two examples are incorrect :-

@thing.stubs(:name).and_return(“Fred”)@

should be :-

@thing.stubs(:name).returns(“Fred”)@

and :-

@thing.expects(:name).and_return(“Fred”)@

should be :-

@thing.expects(:name).returns(“Fred”)@

Also the link to the Mocha API is incorrect :-

http://mocha.rubyforge.com/

should be :-

http://mocha.rubyforge.org/

Regards, James Mead (author of Mocha)

Head_shot_pragsmall
09 May 2010, 23:21
Noel Rappin (49 posts)

James is correct, I inadvertently used the syntax of a different mock package in those examples. I’m sorry about that, it’s rather embarrassing.

Noel

You must be logged in to comment