beberlei / assert

Thin assertion library for use in libraries and business-model
Other
2.41k stars 188 forks source link

notEq message can be confusing regarding expected value #258

Closed rskuipers closed 5 years ago

rskuipers commented 6 years ago

First of all, thank you for this library 👍.

I noticed that when using notEq I was getting a message which may be consistent with the rest but reads very odd in an error.

Assert::that('foobar')->notEq('foobar');
// Assert\InvalidArgumentException: Value "foobar" is equal to expected value "foobar".

When reading this it looks like I'm expecting to get foobar as a value, but the opposite is true. Is this something we should change or is there other reasoning behind this?

I'd be happy to make a PR.

rquadling commented 6 years ago

That does look wrong. A PR would be good. If you fancy, review the rest of the messages too.

rskuipers commented 6 years ago

@rquadling Will do :+1: