[Ann] New version of Mocketry 3.0
I am glad to present simplest mocks for Pharo. In this version Mocketry is dramatically improved and changed. I try to provide most simple way to stub any message to any object and to verify any occurred behaviour. You can read full details in my blog http://dionisiydk.blogspot.fr/2016/04/new-version-of-mocketry-30.html Here is short example: mock := Mock new. mock *stub* someMessage *willReturn:* 1000. mock someMessage should be: 1000. mock *should got* someMessage. mock *should not* *got* anotherMessage. rect := 0@0 corner: 2@3. rect *stub* width willReturn: 1000. rect area should be: 3000 "area = width * height". rect *should got* width.
And I add chapters in PharoInProgress 2016-04-06 14:29 GMT+02:00 Denis Kudriashov <dionisiydk@gmail.com>:
I am glad to present simplest mocks for Pharo. In this version Mocketry is dramatically improved and changed. I try to provide most simple way to stub any message to any object and to verify any occurred behaviour.
You can read full details in my blog http://dionisiydk.blogspot.fr/2016/04/new-version-of-mocketry-30.html
Here is short example:
mock := Mock new. mock *stub* someMessage *willReturn:* 1000. mock someMessage should be: 1000. mock *should got* someMessage. mock *should not* *got* anotherMessage. rect := 0@0 corner: 2@3. rect *stub* width willReturn: 1000. rect area should be: 3000 "area = width * height". rect *should got* width.
Hi, Nice work! 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. Also, for this statement: mock stub someMessage willReturn: 1000. I think I would favor: mock stub someMessage toReturn: 1000. or mock stub someMessage returns: 1000. What do you think? Cheers, Doru
On Apr 6, 2016, at 5:29 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
I am glad to present simplest mocks for Pharo. In this version Mocketry is dramatically improved and changed. I try to provide most simple way to stub any message to any object and to verify any occurred behaviour.
You can read full details in my blog http://dionisiydk.blogspot.fr/2016/04/new-version-of-mocketry-30.html
Here is short example:
mock := Mock new. mock stub someMessage willReturn: 1000.
mock someMessage should be: 1000. mock should got someMessage. mock should not got anotherMessage.
rect := 0@0 corner: 2@3. rect stub width willReturn: 1000.
rect area should be: 3000 "area = width * height". rect should got width.
-- www.tudorgirba.com www.feenk.com "Every thing has its own flow."
2016-04-06 14:51 GMT+02:00 Tudor Girba <tudor@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. #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 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].
Hi,
On Apr 6, 2016, at 6:13 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-06 14:51 GMT+02:00 Tudor Girba <tudor@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. Cheers, Doru
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].
-- www.tudorgirba.com www.feenk.com "What is more important: To be happy, or to make happy?"
Tudor Girba-2 wrote
It is your prerogative :), but âshould got" sounds broken :(.
Sounds like fingernails on a chalkboard IMH-native-english-speaker-O ;) ----- Cheers, Sean -- View this message in context: http://forum.world.st/Ann-New-version-of-Mocketry-3-0-tp4888628p4890904.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Thank you! Doru
On Apr 20, 2016, at 10:35 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-20 2:27 GMT+02:00 Sean P. DeNigris <sean@clipperadams.com>: Tudor Girba-2 wrote
It is your prerogative :), but âshould got" sounds broken :(.
Sounds like fingernails on a chalkboard IMH-native-english-speaker-O ;)
Ok. I open new thread about names
-- www.tudorgirba.com www.feenk.com "It's not how it is, it is how we see it."
Hello guys, a feature idea/request⦠This weekend I was binge-watching talks from Ruby conferences, by Sandi Metz and Katrina Owen on OO design, refactoring, and testing. Highly recommended, and at least Sandi is an experienced smalltalker. See for instance RailsConf 2016 - Succession by Katrina Owen <https://www.youtube.com/watch?v=59YClXmkCVM> or Rails Conf 2013 The Magic Tricks of Testing by Sandi Metz <https://www.youtube.com/watch?v=URSWYvyc42M> In particular, in the second one, Sandi remarks that there is a risk that the application API diverges from the set of messages checked with the mocks. There are tools to help with that, mostly involving the mocks checking that each message they expect actually exists in the application. In Mocketry, mocks are created ex-nihilo, but it could be nice to pass a reference class to compare with, or for the mock to check that there are implementors of the message. On 20 April 2016 at 22:54, Tudor Girba <tudor@tudorgirba.com> wrote:
Thank you!
Doru
On Apr 20, 2016, at 10:35 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-20 2:27 GMT+02:00 Sean P. DeNigris <sean@clipperadams.com>: Tudor Girba-2 wrote
It is your prerogative :), but âshould got" sounds broken :(.
Sounds like fingernails on a chalkboard IMH-native-english-speaker-O ;)
Ok. I open new thread about names
-- www.tudorgirba.com www.feenk.com
"It's not how it is, it is how we see it."
-- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
Le 19/4/16 15:46, Tudor Girba a écrit :
Hi,
On Apr 6, 2016, at 6:13 AM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-04-06 14:51 GMT+02:00 Tudor Girba <tudor@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 :(.
+1 :)
#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.
Cheers, Doru
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].
-- www.tudorgirba.com www.feenk.com
"What is more important: To be happy, or to make happy?"
participants (5)
-
Damien Pollet -
Denis Kudriashov -
Sean P. DeNigris -
stepharo -
Tudor Girba