Created
September 5, 2010 00:50
-
-
Save drewbourne/565630 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// creating manually | |
package | |
{ | |
public class ManualMockolates | |
{ | |
public var thing:Thing; | |
[Before(async, timeout=5000)] | |
public function prepareMockolates():void | |
{ | |
Async.proceedOnEvent(this, | |
prepare(Thing), | |
Event.COMPLETE); | |
} | |
[Test] | |
public function useThing():void | |
{ | |
// you create a thing use nice() or strict() | |
thing = nice(Thing); | |
} | |
} | |
} | |
// using flexunit & mockolate rule | |
package | |
{ | |
public class UsingMockolateRule | |
{ | |
[Rule] | |
public var mocks:MockolateRule = new MockolateRule(); | |
[Mock] | |
public var thing: | |
[Test] | |
public function useThing():void | |
{ | |
// thing has been created for you, no need to call nice() or strict() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment