Re: [Pharo-users] Mocketry willGenerateValueFrom: (was: Re: How do you mock http?)

2017-10-17 Thread Denis Kudriashov
2017-10-17 14:49 GMT+02:00 Herby Vojčík : > Denis Kudriashov wrote: > >> I would hide the tricks even more: >> >>ZnClient stubRequests: [ :request | >>request uri = >> ('https://onesignal.com/api/v1/players/{1}?app_id={2} >>

Re: [Pharo-users] Mocketry willGenerateValueFrom: (was: Re: How do you mock http?)

2017-10-17 Thread Herby Vojčík
Denis Kudriashov wrote: I would hide the tricks even more: ZnClient stubRequests: [ :request | request uri = ('https://onesignal.com/api/v1/players/{1}?app_id={2} ' format: { self uidy: 'Q7'. appId }) asZnUrl and: [

Re: [Pharo-users] Mocketry willGenerateValueFrom: (was: Re: How do you mock http?)

2017-10-17 Thread Herby Vojčík
Denis Kudriashov wrote: Hi Herby. There is message #will: which accepts the block with possible arguments (if needed). ZnClient stub new will: [ ZnMockClient ...] But generally your approach looks bad to me. You put too many details on your tests which just duplicate Zinc API used in the

Re: [Pharo-users] Mocketry willGenerateValueFrom: (was: Re: How do you mock http?)

2017-10-17 Thread Denis Kudriashov
Hi Herby. There is message #will: which accepts the block with possible arguments (if needed). ZnClient stub new will: [ ZnMockClient ...] But generally your approach looks bad to me. You put too many details on your tests which just duplicate Zinc API used in the domain code. It makes tests

[Pharo-users] Mocketry willGenerateValueFrom: (was: Re: How do you mock http?)

2017-10-17 Thread Herby Vojčík
Herby Vojčík wrote: Hello! I felt the need to mock http api (like nock in node, that is, mock http request-response itself on low-level part, leaving aside the question of what wrapper / library one uses to get to that http; in node it mocks basic http layer, here I tackled ZnClient), but