Tuesday, May 15, 2007

Mocha - Mocking framework for Ruby




I'm getting heavily into testing my Rails applications, and am learning about Mocking and Stubbing. I'm learning about Mocha, a Ruby library to help with Mocking. err the blog has a good post about Mocha, as does Agile Testing.

Mocha looks like it integrates nicely with test/spec. I find Specifications to be much more useful than Tests, with Specifications, it just seems more like how I think, like "The application should do this". What I really like about test/spec, as opposed to rspec is that with test/spec, your Specifications live right alongside with your Tests, and you can use either one, depending on which makes more sense at the time.

I'm seeing some situations in my code where Tests do make more sense to program, and I like being able to use both.