It feels backwards to me too, in the same way that "one plus one equals two" feels more natural than "two equals one plus one".
-- Cheers, Peter. On 30 apr 2011, at 16:20, Mariano Martinez Peck <[email protected]> wrote: > Hi guys. I always code my tests something like this: > > testBlah > | universalAnswer | > universalAnswer := 30. > universalAnswer := universalAnswer + 11. > self assert: universalAnswer equals: 42. > > In this case, 42 is the "expected" and "universalAnswer" is the "actual" > value. > I feel weird writing like this: > > self assert: 42 equals: universalAnswer. > > I don't know why...but I do..the same as when doing should: [] raise: Error. > In that case you put the "actual" first and the "expected" at the end... > > ok....the "problem" is that assert:equals: is in fact: asserts: expected > equals: actual instead of > asserts: actual equals: expected > > So, with my test I would receive a description in the debugger that says > "'Expected 41 but was 42.'" > which is completely the opposite. Of course, if I write my tests in the way I > don't like, that is: > self assert: 42 equals: universalAnswer. > > then i got the correct message "'Expected 42 but was 41.'" > > I don't pretend pharo change this because I guess it is standard, and blah > blah blah. But senders of #assert:equals: should both, some written as mine > (so the message is incorrect for them) and some correct. > > In addition, I think it is a problem of the selector name. If we could make > it clearer, the won't be necessary to confuse "actual" with "expected". > > Cheers > > -- > Mariano > http://marianopeck.wordpress.com >
