groupon / assertive

Assertive is a terse yet expressive assertion library
BSD 3-Clause "New" or "Revised" License
21 stars 11 forks source link

reset color before displaying error message #4

Closed EndangeredMassa closed 10 years ago

EndangeredMassa commented 10 years ago

Mocha (and probably other test libraries) makes the error text red when it catches something. This makes assertive's error message red up to the point where (for example) it's turned green for the expected value. This ruins the effect.

This change clears color information before displaying the error message, which can then control its own color codes.

[RED]Error: Assertion failed: The response is OK
Expected: [GREEN]200
[CLEAR]Actually: [RED]500

Above, Expected: is red instead of clear. With this change, it looks like:

[RED]Error: Assertion failed: The response is OK
[CLEAR]Expected: [GREEN]200
[CLEAR]Actually: [RED]500
EndangeredMassa commented 10 years ago

@johan can you verify these changes?

ageitgey commented 10 years ago

I like it.

johan commented 10 years ago

@EndangeredMassa Looks good to me – :+1:

EndangeredMassa commented 10 years ago

published in 1.3.1