Mocha | August 18th, 2006
Mocha is a library for mocking and stubbing within tests using a syntax like that of JMock and SchMock.
Woohoo! - I finally found a mock tool that look like it can actually handle mocking out ActiveRecord classes on the fly! Truth be told, I haven’t had a chance to put this into production, but I hope to shortly.
I was incredibly frustrated with the way Rails handles mocks precisely because it doesn’t handle ActiveRecord mocking very well. Plus it handles both stubbing and mocks - with expectations. I may have finally found in Ruby what I had in PHP - I missed SimpleTest - it’s good to have a replacement.
August 25th, 2006 at 3:19 pm (subscribed to comments)
I’m glad you like the look of Mocha. It should do what you want - that’s exactly what we’re using it for. Let me know if you run into any problems with it - feedback is always welcome.