machine.specifications icon indicating copy to clipboard operation
machine.specifications copied to clipboard

Would you mind if I add the ability to include a failure message in all assertions?

Open penderi opened this issue 10 years ago • 4 comments

I find it helps those supporting code after me (or after I've left code behind for 6m+) if I have a failure message for the assertion fail.

I realies some BDD fanboys may hate this, this my question.

If there's no opposition I can post a PR in no time... just canvassing opinion...

penderi avatar Aug 26 '16 08:08 penderi

Can you give an example of what you mean? I don't know what you mean, because assertions usually have a message.

agross avatar Aug 26 '16 08:08 agross

Hi @agross "!! Yes I can. I'm trying to say I would like to use the following:

testId.ShouldEqual(userId, "Did not request userId");

.... and seeing the custom message in the test output...

penderi avatar Aug 26 '16 09:08 penderi

OK, I get it now. You should submit your PR here: https://github.com/machine/machine.specifications.should

agross avatar Aug 26 '16 09:08 agross

OH WOW. Awesome. I certainly will!

penderi avatar Aug 26 '16 10:08 penderi