redding / assert

Assertion style testing framework.
https://github.com/redding/assert
MIT License
10 stars 1 forks source link

use the equality operator of the exp value in equal assertions #187

Closed kellyredding closed 10 years ago

kellyredding commented 10 years ago

This switches the order of the equality comparison in assert_equal to prefer the equality operator of the expected value. The idea is that the expected value is known and intended so it should be the "basis" for the equality test as opposed to the actual value that is unknown not always intended.

This is a very subtle change that really only comes into play when you are comparing two objects that both define a custom equality operator.

Closes #184.

@jcredding ready for review.

jcredding commented 10 years ago

@kellyredding - Looks good :boom: Your commit message at the beginning has both "adds" and "switches". I think you just want "This switches the order".