[Pharo-dev] Mocketry names again

Carlos Lombardi carlombardi at gmail.com
Tue Apr 26 18:33:34 EDT 2016


... maybe

#result should beTheResultOf: [mock someMessage].
#result should not beTheResultOf: [mock anotherMessage].

Cordially - Carlos

On Wed, Apr 20, 2016 at 9:22 PM, Denis Kudriashov <dionisiydk at gmail.com>
wrote:

>
> 2016-04-20 20:36 GMT+02:00 S Krish <krishnamachari.sudhakar at gmail.com>:
>
>> result should return: [mock someMessage]
>
>
> It should verify that result was returned from message defined inside
> block. That's why I use  "should beReturnedFrom: [mock someMessage]".
> Following test demonstrates idea:
>
> mock := Mock new.
> mock stub someMessage willReturn: #result.
>
> mock stub anotherMessage willReturn: #anotherResult.
>
>
> mock someMessage should be: #result.
> mock anotherMessage should be: #anotherResult.
>
> #result should beReturnedFrom: [mock someMessage].
>
> #result should not beReturnedFrom: [mock anotherMessage]
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20160427/a62ffcfc/attachment.html>


More information about the Pharo-dev mailing list