On 2 June 2012 22:58, Tudor Girba <[email protected]> wrote: > Hi Igor, > > I am not sure I understand. This would still not test the final logic, would > it? > ok.. here the abstract code snippet.
w := Watcher new. w delegate: myDelegate. w buildThatMorph. now as result.. you delegate receives a message #morphAreBuilt: with morph as argument. so, you can choose either to add it to world, or you can choose to test its contents without adding anywhere, depending who is a delegate. > Cheers, > Doru > > > On 30 May 2012, at 14:15, Igor Stasenko wrote: > >> I still remember that code a bit.. >> so, you need a place where you can hook in and validate the morph. >> Piece of cake: in your watcher object, delegate the event "building >> done" to some other object.. >> that "other object" in default case will use #addDeferredUIMessage... >> and add this morph to scene. >> And in case of test, you free to do anything else then.. >> >> >> On 30 May 2012 07:43, Tudor Girba <[email protected]> wrote: >>> Hi, >>> >>> I have a piece of code that builds a morph in a parallel process, and I >>> would like to test that it builds the right thing. >>> >>> The building of the morph can take long. My current solution is to add a >>> delay, but this is ugly and unreliable: >>> >>> "setup and trigger the morph building" >>> (Delay forMilliseconds: 1000) wait. >>> "assert that the morph is correct" >>> >>> The question is if there is a better way. >>> >>> Cheers, >>> Doru >>> >>> >>> -- >>> www.tudorgirba.com >>> >>> "We are all great at making mistakes." >>> >>> >>> >>> >>> >>> >>> >>> >> >> >> >> -- >> Best regards, >> Igor Stasenko. >> > > -- > www.tudorgirba.com > > "Some battles are better lost than fought." > > > > -- Best regards, Igor Stasenko.
