2016-04-06 14:51 GMT+02:00 Tudor Girba <tu...@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. #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 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].