Hello,
I am wondering if there is a way to use a custom failure message for message expectations with rspec-mocks. I'm writing some helper methods that use message expectations under the hood. Unlike custom matchers from rspec-expectations, message expectations always give a failure message like this:
Failure/Error: Unable to find matching line from backtrace
Exactly one instance should have received the following message(s) but didn't: foo
I would like to be able to output an error message that speaks in the domain of my program. As an example, I'd like to use this text:
Failure/Error: Message failed to trigger route
Expected message "bar" to route to :foo, but didn't.
Is something like this possible? Thanks!
Jimmy