mockolate icon indicating copy to clipboard operation
mockolate copied to clipboard

test using mockolate 10.0 and flexunit 4.1 rc2 says proxy isn't prepared

Open slackmage opened this issue 14 years ago • 3 comments

slackmage avatar Mar 01 '11 18:03 slackmage

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

drewbourne avatar Mar 01 '11 21:03 drewbourne

The code in this Gist passes: https://gist.github.com/851909

HTH, Drew

drewbourne avatar Mar 02 '11 22:03 drewbourne

Ian, did you resolve this issue?

drewbourne avatar Aug 08 '11 12:08 drewbourne