[Pharo-dev] [Ann] New version of Mocketry 3.0

Tudor Girba tudor at tudorgirba.com
Tue Apr 19 09:46:15 EDT 2016


> On Apr 6, 2016, at 6:13 AM, Denis Kudriashov <dionisiydk at gmail.com> wrote:
> 2016-04-06 14:51 GMT+02:00 Tudor Girba <tudor at 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 :(.

> #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.


> 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].


"What is more important: To be happy, or to make happy?"

More information about the Pharo-dev mailing list