April 27, 2009

New in RSpec edge: stub_chain

My feature addition to RSpec was accepted this weekend. If you've got a named_scope chain or need to stub out @model.errors.full_messages.to_sentence, you're going to be typing a lot less:

   1      @model.stub_chain(:errors, :full_messages, :to_sentence).and_return('the errors')
   2  
Look for it in the next RSpec release!

Post a comment