Le 19/4/16 15:46, Tudor Girba a écrit :
Hi,
On Apr 6, 2016, at 6:13 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-06 14:51 GMT+02:00 Tudor Girba <tudor@tudorgirba.com>: Just the English does not sound quite well for statements like: mock should got someMessage mock should not got anotherMessage.
I know that there was a long discussion about naming these. I do not remember the outcome, but still I think other alternatives would be better: mock should haveReceived someMessage. mock should not haveReceived anotherMessage. or even mock shouldnt haveReceived anotherMessage.
You right. There was discussion and I made decision :) Some of people suggest "should got" which is very short version and I like it. I know it is not completely correct from English perspective but it is readable enough and understandable. It is your prerogative :), but âshould got" sounds broken :(.
+1 :)
#shouldnt can be good. But usually we not use "should not" assertions. Only when we really want to deny certain condition we write it such way. In that cases full form of "should not" feels better for me. But it is always personal choice. So I made decision. (many my tests uses "should not" :)) I think âshould not" sounds fine like it is.
Cheers, Doru
I think I would favor: mock stub someMessage toReturn: 1000. or mock stub someMessage returns: 1000.
What do you think?
Same here. Mocketry is very old and it was always idea of will:. You can also put block for expected action: mock stub someMessage will: [#yourResult]. (mock stub someMessageWith: Any) will: [:arg | arg + 1].
-- www.tudorgirba.com www.feenk.com
"What is more important: To be happy, or to make happy?"