<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Hello Denis,</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">thank you very much for your detailed explanations! This was really helpful for understanding how the behavior verification works. The implementation of ignoring of message sends basically worked fine this way.</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Concerning this I would like to know if the following expression should pass or raise a WrongMessageSelector failure:</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">[:mock | mock message1; message2]  should strictly satisfy: </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">        </span>[:mock | mock message2 useArbitrarily. mock message1.].</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Actually the StrictBehaviorSpec requires that #message2 should be called before #message1. The arbitrarily property only specifies that the number of invocations of #message2 is not important. If so, the expression ought to fail with the invocation of #message2. Is that correct?</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Best regards,</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Robert</font></div> <div><div><br class="webkit-block-placeholder"></div><div>Am 19.09.2007 um 14:32 schrieb Denis Kudriashov:</div><br class="Apple-interchange-newline"><blockquote type="cite">2007/9/19, Robert Krahn &lt;<a href="mailto:rksm@gmx.net">rksm@gmx.net</a>&gt;:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div style=""> <div style="margin: 0px;"><span class="q"><div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> Hello Denis,</font></div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> I dipped into your BehaviorMockup package and it seems really powerful. I like the block notation so that the expected behavior is stated after the exercised code. This way the tests can be more uniform (Four-Phase Test) and clearer. </font></div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> One thing I didn't found out is how to have the mocks ignore certain message calls.</font></div><div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> E.g. I want this to pass:</font></div><div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> [:mock | mock m1; m2] should lenient satisfy: [:mock | mock m1]</font></div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> I tried it the 'lenient way' as above but I get a SpecFailed: WrongMessageSelector. How can one do this?</font></div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> Best regards,</font></div><div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> Robert</font></div><div style="margin: 0px; min-height: 14px;"><br></div></span><div style="margin: 0px; min-height: 14px;">p.s.</div><div style="margin: 0px; min-height: 14px;">I wrote this mail to the squeak-dev mailing list first but forgot to add your mail address in the header so I am writing you an extra mail. </div></div></div></blockquote><div><br>Hi Robert.<br> <br><span class="q"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> Expression<br><br></font></span><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><span class="q"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> [:mock | mock m1; m2] should lenient satisfy: [:mock | mock m1]</font></span><br></blockquote><span class="q"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> <br> creates and verifies LenientBehaviorSpec. It only defines arbitrary message sends order.<br><br>If you want mock ignores any message sends you must write something like:<br><br></font></span><div style="margin-left: 40px;"> <span class="q"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> [:mock | mock m1; m2] should lenient satisfy: [:mock | mock anyMessage. mock m1]</font></span><br></div><span class="q"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="3"> <br>But it is not implemented yet. I think it takes a few hours work..<br><br></font></span></div></div>Possible implementation: <br><ul><li>Create subclass MessageSemanticsSpec named like AnyMessageSemanticsSpec</li><li> Implement #validate: method like in MessageSemanticsSpec but without some testings for message selector and arguments</li><li>Change method BehaviorSpecBuilder&gt;&gt;evaluateBehavior:</li></ul><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">     <blockquote><blockquote>      </blockquote></blockquote></blockquote><div style="margin-left: 80px;">aMessageSend selector = #anyMessage ifTrue: [</div><blockquote style="margin-left: 40px;">    </blockquote>    <blockquote style="margin-left: 40px;">    </blockquote><div style="margin-left: 120px;">messageSendSpec := MessageSendSpec new.<br> messageSendSpec add: (AnyMessageSemanticsSpec from: aMessageSend).<br> spec add: messageSendSpec.<br>  ^MessageSendSpecBuilder on: messageSendSpec]<br>     </div><div style="margin-left: 80px;"> <br> messageSendSpec := MessageSendSpec withMessageSemanticsLike: aMessageSend.<br>spec add: messageSendSpec.<br> ^MessageSendSpecBuilder on: messageSendSpec<br><br></div>With that stuff you can write specification for ignoring any message any times: <br><br><div style="margin-left: 40px;">mock anyMessage useArbitrary<br></div><br>And use null object (with eating message sends):<br><br><div style="margin-left: 40px;">mock anyMessage <br><div style="margin-left: 40px;"> <div style="margin-left: 40px;">useArbitrary<br></div><div style="margin-left: 40px;">willReturn: Null new<br></div><br></div></div>Of course you can implement some nice helper messages for it.<br><br>Sorry for my english. <br><br>Best regards, <br>Denis<br> <br><div style="margin-left: 80px;">    </div><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><blockquote><blockquote>      </blockquote> </blockquote> </blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> </blockquote></div><br></body></html>