Re: [Pharo-users] using mocketry to mock subcall

2017-10-24 Thread Denis Kudriashov
Hi 2017-10-24 20:07 GMT+02:00 Herby Vojčík : > Denis Kudriashov wrote: > >> Hi Herby. >> >> 2017-10-20 18:49 GMT+02:00 Herby Vojčík > >: >> >> >> I had this problem. I tried something like (though not exactly w/ >> this code): >> >> Foo stub new will: [ :aMess

Re: [Pharo-users] using mocketry to mock subcall

2017-10-24 Thread Herby Vojčík
Denis Kudriashov wrote: Hi Herby. 2017-10-20 18:49 GMT+02:00 Herby Vojčík mailto:he...@mailbox.sk>>: I had this problem. I tried something like (though not exactly w/ this code): Foo stub new will: [ :aMessage | | original | original := MockExpectedOriginalCall new e

Re: [Pharo-users] using mocketry to mock subcall

2017-10-23 Thread Denis Kudriashov
Hi Herby. 2017-10-20 18:49 GMT+02:00 Herby Vojčík : > > > I had this problem. I tried something like (though not exactly w/ this > code): > > Foo stub new will: [ :aMessage | > | original | > original := MockExpectedOriginalCall new executeFor: aMessage. > original stub. > ^ original ] > >

Re: [Pharo-users] using mocketry to mock subcall

2017-10-20 Thread Herby Vojčík
Denis Kudriashov wrote: So you want to stub message to *any* instance of class. Right? Conceptually, in Mocketry/StateSpecs way, it should looks like: (Instance of: Something) stub askForName willReturn: 'new'. or: (Kind of: Something) stub askForName willReturn: 'new'. But it w

Re: [Pharo-users] using mocketry to mock subcall

2017-10-20 Thread Denis Kudriashov
So you want to stub message to *any* instance of class. Right? Conceptually, in Mocketry/StateSpecs way, it should looks like: (Instance of: Something) stub askForName willReturn: 'new'. or: (Kind of: Something) stub askForName willReturn: 'new'. But it will not really works. It will work onl

Re: [Pharo-users] using mocketry to mock subcall

2017-10-20 Thread Peter Uhnák
Ah, right. I was expecting that other objects sending the message will receive the mocked result. Thanks, Peter On Fri, Oct 20, 2017 at 2:21 PM, Denis Kudriashov wrote: > Yes, but in that case you stub messages to the class itself. For your > example it means: > > Something stub askForName will

Re: [Pharo-users] using mocketry to mock subcall

2017-10-20 Thread Denis Kudriashov
Yes, but in that case you stub messages to the class itself. For your example it means: Something stub askForName willReturn: 'new'. Something askForName should be: 'new' 2017-10-20 13:58 GMT+02:00 Peter Uhnák : > Thanks Denis, that did the trick. > > But I thought that I can also mock at the

Re: [Pharo-users] using mocketry to mock subcall

2017-10-20 Thread Peter Uhnák
Thanks Denis, that did the trick. But I thought that I can also mock at the class level (at least it was shown in the docs). Peter On Sat, Oct 7, 2017 at 11:24 AM, Denis Kudriashov wrote: > Hi Peter. > > You should stub instance instead of class: > s := Something new. > s stub askFor

Re: [Pharo-users] using mocketry to mock subcall

2017-10-07 Thread Denis Kudriashov
Hi Peter. You should stub instance instead of class: s := Something new. s stub askFor... 7 окт. 2017 г. 9:18 пользователь "Peter Uhnák" написал: > Hi, > > maybe I am missing something fundamental, because this seems like an > obvious scenario > > I have a class Something with two met