drewbourne / mockolate

fake chocolate, mock objects and test spies for AS3
http://mockolate.org/
MIT License
145 stars 27 forks source link

MockolateRule should verify instances created with strict() and nice() #17

Closed drewbourne closed 14 years ago

drewbourne commented 14 years ago

When using the MockolateRule it should hook into strict() and nice() and verify instances created with those in VerifyMockInstance.

drewbourne commented 14 years ago

MockolateRule now has nice() and strict() methods that will add the instances created with them to the list of instances to automatically verify after the test.

[Rule]
public var mocks:MockolateRule = new MockolateRule();

[Mock]
public var flavour:Flavour;

[Test]
public function needsMoreFlavours():void {
    var flavour2:Flavour = mocks.nice(Flavour);
    var flavour3:Flavour = mocks.strict(Flavour);
}