I am writing some unit tests for my Ruby on Rails application. I would like to test that my model received a message to a particular method. In RSpec this is done with the should_receive incantation.
Is there an equivalent to Test::Unit that can do the same? If Test::Unit cannot do it, is there a tool I can use in concert with it to get that functionality?
Check out mocha. It is a gem that you can use with Test::Unit or Rspec (but I prefer the native rspeck mocking). It allows you to write something like
Hope this helps