Created
March 2, 2011 22:32
-
-
Save drewbourne/851909 to your computer and use it in GitHub Desktop.
This file contains 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
package org.mockolate.issues | |
{ | |
import flash.external.ExternalInterface; | |
public class JSBridge | |
{ | |
private static var instance:JSBridge; | |
private static var allowInstantionation:Boolean; | |
public static function getInstance():JSBridge | |
{ | |
if (instance) | |
{ | |
return JSBridge.instance; | |
} | |
else | |
{ | |
allowInstantionation = true; | |
instance = new JSBridge() | |
allowInstantionation = false; | |
return instance; | |
} | |
} | |
public function JSBridge() | |
{ | |
super(); | |
} | |
public function send(... arguments):void | |
{ | |
ExternalInterface.call.apply(null, arguments); | |
} | |
} | |
} |
This file contains 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
package org.mockolate.issues | |
{ | |
import mockolate.runner.MockolateRule; | |
public class JSBridgeTest | |
{ | |
[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"); | |
} | |
} | |
} |
This file contains 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
package org.mockolate.issues | |
{ | |
public class PanelOpenDelegate | |
{ | |
public var jsBridge:JSBridge; | |
public function openPanelJS(id:int, name:String):void | |
{ | |
jsBridge.send("prOpenPanel", id, name); | |
} | |
} | |
} |
It is quite possible that FlexMojos isn't doing the right thing.
We're using these versions:
- FlexMojos 4.0-beta-3
- Mockolate 0.10.0
And FlexUnit with these dependencies:
<!-- flexunit -->
<dependency>
<groupId>org.flexunit</groupId>
<artifactId>flexunit-core-flex</artifactId>
<version>4.1.0</version>
<type>swc</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.flexunit</groupId>
<artifactId>flexunit-cilistener</artifactId>
<version>4.1.0</version>
<type>swc</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.flexunit</groupId>
<artifactId>flexunit-uilistener</artifactId>
<version>4.1.0</version>
<type>swc</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.adobe.flexunit</groupId>
<artifactId>flexunit</artifactId>
<version>4.0-beta-2</version>
<type>swc</type>
<scope>test</scope>
</dependency>
Hey Drew,
Do you have mockolate on a maven repository somewhere or do you just have it installed locally?
Thanks,
Michael
Michael,
No Maven repo for Mockolate yet. I copy the swc to the projects I'm using
Mockolate with.
cheers,
Drew
…On Fri, May 6, 2011 at 2:19 AM, mikeycmccarthy < ***@***.***>wrote:
Hey Drew,
Do you have mockolate on a maven repository somewhere or do you just have
it installed locally?
Thanks,
Michael
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/851909
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Drew, same error
Error: No Mockolate for that target, received:
Could this be tied to flexmojos method running tests in maven somehow?