Always output variables when using assertEquals()

Description

using assertEquals(foo, bar) will output what foo and bar are if the assertion fails.

If we specify the 3rd optional parameter for an error message, using assertEquals(foo, bar, "foo"), will only output the message.

MXUnit would also in this case include the two variables too. Would be very convenient if you could make TestBox do the same too. Otherwise we would need to rewrite many tests to also dump them out, or remove our own error messages.

Gliffy Diagrams

Activity

Show:

Adam CameronMay 11, 2014 at 6:41 AM

Yep, I'll be there. I'll be @ CF.Objective() too, now (found out on Fri).

Luis MajanoMay 11, 2014 at 6:28 AM

Gracias my friend, I took a stab at it and it is ready for the 2.0 beta release next week. By the way, are you going to SOTR?

Adam CameronMay 11, 2014 at 6:26 AM

Hi Luis. I would not presume to make a pull request (or indeed do the work) prior to agreeing there's work to be done! It'd just be a waste of everyone's time. That said, in a situation in which we do agree, am happy to do the work if it's not high on your radar. That said: it's not high on our radar either as we had issues upgrading to 2.0, so we are stuck on an old version anyhow. We do not have time to dedicate to work through / identify the 2.0 issues just yet... I am trying to get that sorted out though.

As far as I know assertEquals() is the only assertion that works like this.

Luis MajanoMay 9, 2014 at 5:23 PM

Also, this only affects assertEquals, what about the other assertions, they are not as easy as just adding to the message "expected [#foo#] received [#bar#]", so you end up tackling more messages to the mix as well.

How about maybe just tackling this:

At the end of the custom messages

Luis MajanoMay 9, 2014 at 5:22 PM

You can always send a pull request, just saying

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Priority

Sentry

Created February 5, 2014 at 4:34 PM
Updated May 11, 2014 at 6:41 AM
Resolved May 9, 2014 at 8:02 PM