Hi. People start argue that my choice of names are not good. For now Mocketry use "should got" to verify that following message was occurred: mock *should got* someMessage This is broken for native english speakers. Do you agree to replace it with correct #haveReceived? Can we use more short version #haveGot? mock should haveReceived someMessage mock should haveGot someMessage Also there is new expression to verify how object was received during test: result should *beReturnedFrom:* [mock someMessage] Should it be #haveReturnedFrom: ? result should haveReturnedFrom: [mock someMessage] I hope we can make consensus and be happy with Mocketry. Best regards, Denis
Why do we need those sophisticated past-something form after should at all? Why not simply mock should receive someMessage ? -- Best regards, Dennis Schetinin 2016-04-20 11:35 GMT+03:00 Denis Kudriashov <dionisiydk@gmail.com>:
Hi.
People start argue that my choice of names are not good.
For now Mocketry use "should got" to verify that following message was occurred:
mock *should got* someMessage
This is broken for native english speakers. Do you agree to replace it with correct #haveReceived? Can we use more short version #haveGot?
mock should haveReceived someMessage
mock should haveGot someMessage
Also there is new expression to verify how object was received during test:
result should *beReturnedFrom:* [mock someMessage]
Should it be #haveReturnedFrom: ?
result should haveReturnedFrom: [mock someMessage]
I hope we can make consensus and be happy with Mocketry.
Best regards, Denis
+1. this is easy and simple for any native / non native english .. Mocketry is really nice btw.. On Wed, Apr 20, 2016 at 7:45 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-20 13:59 GMT+02:00 Dennis Schetinin <chaetal@gmail.com>:
Why do we need those sophisticated past-something form after should at all? Why not simply
mock should receive someMessage
?
Maybe. What others think?
result should return: [mock someMessage] On Wed, Apr 20, 2016 at 1:35 PM, S Krish <krishnamachari.sudhakar@gmail.com> wrote:
+1.
this is easy and simple for any native / non native english ..
Mocketry is really nice btw..
On Wed, Apr 20, 2016 at 7:45 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-20 13:59 GMT+02:00 Dennis Schetinin <chaetal@gmail.com>:
Why do we need those sophisticated past-something form after should at all? Why not simply
mock should receive someMessage
?
Maybe. What others think?
2016-04-20 20:36 GMT+02:00 S Krish <krishnamachari.sudhakar@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]
... 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@gmail.com> wrote:
2016-04-20 20:36 GMT+02:00 S Krish <krishnamachari.sudhakar@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]
2016-04-27 0:33 GMT+02:00 Carlos Lombardi <carlombardi@gmail.com>:
... maybe
#result should beTheResultOf: [mock someMessage]. #result should not beTheResultOf: [mock anotherMessage].
It's nice.I think "The" can be omitted: #result should beResultOf: [mock someMessage]. But anyway I use word #return because there are different types of result: value return and error signal. There is no expression for last case but it would be like: anError should beRaisedBy: [mock someMessage]
Hi again, ok, just to have coherence between the names for the two possible outcomes of a method, you could use #beReturnedBy instead of #beReturnedFrom: . You would have #beReturnedBy: and #beRaisedBy: On Wed, Apr 27, 2016 at 10:00 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-27 0:33 GMT+02:00 Carlos Lombardi <carlombardi@gmail.com>:
... maybe
#result should beTheResultOf: [mock someMessage]. #result should not beTheResultOf: [mock anotherMessage].
It's nice.I think "The" can be omitted:
#result should beResultOf: [mock someMessage].
But anyway I use word #return because there are different types of result: value return and error signal. There is no expression for last case but it would be like:
anError should beRaisedBy: [mock someMessage]
So at the end of week I will rename "should got" into "should receive" 2016-04-27 23:39 GMT+02:00 Carlos Lombardi <carlombardi@gmail.com>:
Hi again,
ok, just to have coherence between the names for the two possible outcomes of a method, you could use #beReturnedBy instead of #beReturnedFrom: . You would have #beReturnedBy: and #beRaisedBy:
On Wed, Apr 27, 2016 at 10:00 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-27 0:33 GMT+02:00 Carlos Lombardi <carlombardi@gmail.com>:
... maybe
#result should beTheResultOf: [mock someMessage]. #result should not beTheResultOf: [mock anotherMessage].
It's nice.I think "The" can be omitted:
#result should beResultOf: [mock someMessage].
But anyway I use word #return because there are different types of result: value return and error signal. There is no expression for last case but it would be like:
anError should beRaisedBy: [mock someMessage]
And done. Version 3.4 deprecates "should got" and introduces "should receive". All docs are updated. Prebuilt PDF can found here https://ci.inria.fr/pharo-contribution/view/Books/job/PharoBookWorkInProgres... 2016-05-18 11:59 GMT+02:00 Denis Kudriashov <dionisiydk@gmail.com>:
So at the end of week I will rename "should got" into "should receive"
2016-04-27 23:39 GMT+02:00 Carlos Lombardi <carlombardi@gmail.com>:
Hi again,
ok, just to have coherence between the names for the two possible outcomes of a method, you could use #beReturnedBy instead of #beReturnedFrom: . You would have #beReturnedBy: and #beRaisedBy:
On Wed, Apr 27, 2016 at 10:00 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-27 0:33 GMT+02:00 Carlos Lombardi <carlombardi@gmail.com>:
... maybe
#result should beTheResultOf: [mock someMessage]. #result should not beTheResultOf: [mock anotherMessage].
It's nice.I think "The" can be omitted:
#result should beResultOf: [mock someMessage].
But anyway I use word #return because there are different types of result: value return and error signal. There is no expression for last case but it would be like:
anError should beRaisedBy: [mock someMessage]
Yuppee! Thanks :) Doru
On May 23, 2016, at 12:18 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
And done. Version 3.4 deprecates "should got" and introduces "should receive". All docs are updated.
Prebuilt PDF can found here https://ci.inria.fr/pharo-contribution/view/Books/job/PharoBookWorkInProgres...
2016-05-18 11:59 GMT+02:00 Denis Kudriashov <dionisiydk@gmail.com>: So at the end of week I will rename "should got" into "should receive"
2016-04-27 23:39 GMT+02:00 Carlos Lombardi <carlombardi@gmail.com>: Hi again,
ok, just to have coherence between the names for the two possible outcomes of a method, you could use #beReturnedBy instead of #beReturnedFrom: . You would have #beReturnedBy: and #beRaisedBy:
On Wed, Apr 27, 2016 at 10:00 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-27 0:33 GMT+02:00 Carlos Lombardi <carlombardi@gmail.com>: ... maybe
#result should beTheResultOf: [mock someMessage]. #result should not beTheResultOf: [mock anotherMessage].
It's nice.I think "The" can be omitted:
#result should beResultOf: [mock someMessage].
But anyway I use word #return because there are different types of result: value return and error signal. There is no expression for last case but it would be like:
anError should beRaisedBy: [mock someMessage]
-- www.tudorgirba.com www.feenk.com "Speaking louder won't make the point worthier."
Denis Kudriashov wrote
Can we use more short version #haveGot? ... mock should haveGot someMessage
No ;) The minimum to not sound terrible would be #haveGotten Denis Kudriashov wrote
beReturnedFrom:... Should it be #haveReturnedFrom:
This one seems less crucial. #have... would technically be correct since you made the others in the past tense, but as other commenters have pointed out, it would simplify things to keep everything in the present tense. Although there would then be the mismatch with the fact that the things did in fact already happen (hopefully) in the past! ----- Cheers, Sean -- View this message in context: http://forum.world.st/Mocketry-names-again-tp4890941p4891092.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
participants (6)
-
Carlos Lombardi -
Denis Kudriashov -
Dennis Schetinin -
S Krish -
Sean P. DeNigris -
Tudor Girba