The current mock functionality in Rails just seems to be server stubs, along with all of the other Ruby mock libraries I've seen. Am I missing something? Is there some reason that Ruby does not need to use mocks as critics?
Printable View
The current mock functionality in Rails just seems to be server stubs, along with all of the other Ruby mock libraries I've seen. Am I missing something? Is there some reason that Ruby does not need to use mocks as critics?
Hi.
I haven't used any mock library in Ruby yet, but don't they allow passing of a block to their methods? You can throw an exception if the expectation is incorrect in the block perhaps? Which library were you looking at? Nat Pryce's original one or some of the derivations?
yours, Marcus
You might want to check out Jim Weirich's FlexMock, if you haven't already. It has great support for acting as a critic.
http://onestepback.org/software/flexmock/