mockolate
mockolate copied to clipboard
test using mockolate 10.0 and flexunit 4.1 rc2 says proxy isn't prepared
Ian,
The rule should not run the test until the classes are prepared. Is there anything odd about the JSBridge class? Is it final, dynamic, etc? Could you include it (or at least its skeleton) so I can try to reproduce this.
Aside: When using the MockolateRule it will create the mock instances for you and verify them after the test. I have modified your example to the form I recommend (and need to document).
public class PanelOpenDelegateTest {
[Rule]
public var mocks:MockolateRule = new MockolateRule();
[Mock(type="strict")]
public var jsBridge:JSBridge;
[Test]
public function testPanelOpenJS() : void {
var delegate:PanelOpenDelegate = new PanelOpenDelegate();
mocks.mock(jsBridge).method("send").args("prOpenPanel",1,"CID");
delegate.jsBridge = jsBridge;
delegate.openPanelJS(1,"CID");
}
}
cheers, Drew
The code in this Gist passes: https://gist.github.com/851909
HTH, Drew
Ian, did you resolve this issue?