[Q] Morphic, how do I force a step?

Andreas Raab andreas.raab at gmx.de
Thu Aug 14 22:21:42 UTC 2003


Okay, the simplest thing to do would be send that Morph a #step method
directly in your test, e.g., "aMorph step". The second simplest thing to do
(which would be more accurate for the overall behavior) is to have the
entire world run a step cycle by saying something like "aMorph world
runStepMethods". The third simplest thing to do (which would be even the
exact behavior of the world) would be to force a full morphic update cycle
by issueing "aMorph world doOneCycleNow". Decisions, decisions ;-)

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On 
> Behalf Of Chris Muller
> Sent: Friday, August 15, 2003 12:16 AM
> To: Squeak List
> Subject: [Q] Morphic, how do I force a step?
> 
> 
> I have SUnit test cases I am writing for my Morph subclass.  
> One of its
> variables I'm testing only gets set during the #step method, 
> so I've decided I
> need to openInWorld my Morph to be able to properly test my 
> assertions against
> it.
> 
> However, in my test-code, the assertion runs too quickly 
> right after I've
> opened it in the world and it's first step hasn't fired just yet.
> 
> I tried a Delay, which didn't seem to work.  A self halt and 
> then resuming
> manually did work but, obviously, I'd like to have hands-off tests.
> 
> Thank you for any suggestions..
> 
>  - Chris
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 



More information about the Squeak-dev mailing list