In rspec: Can I attach a message to a check the same way as I would do in xUnit style test frameworks? How?
assert_equal value1, value2, "something is wrong"
should
and should_not
take a second argument (message
) that overrides the matcher’s default message.
1.should be(2), 'one is not two!'
The default messages are usually pretty useful though.
update:
for RSpec 3:
expect(1).to eq(2), "one is not two!"