Skip to content

Instantly share code, notes, and snippets.

@drewbourne
Created September 5, 2010 00:50
Show Gist options
  • Save drewbourne/565630 to your computer and use it in GitHub Desktop.
Save drewbourne/565630 to your computer and use it in GitHub Desktop.
// 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