Skip to content

Generate a useful description for have_received

Created by: jferris

  • Makes it { should have_received(:message) } produce useful output

Resolves #254 (closed).

A few implementation notes:

  • I added the actual description to ErrorGenerator, as it has a lot of useful, reusable behavior related to messages. However, it's not a message, so maybe it should go somewhere else, or that class should be renamed to "MessageGenerator"?
  • I separated Proxy#build_expectation into two phases so that exceptions won't be raised when calling matches? or description. Otherwise, you don't get a description if you mess up the stub.

Merge request reports