CC-Archived / promise-as3

Promises/A+ compliant implementation in ActionScript 3.0
167 stars 52 forks source link

Issues with testing and Mockolate #27

Open nestradaOBS opened 10 years ago

nestradaOBS commented 10 years ago

Hello,

I'm trying to mock some interfaces which return promises and it seems that mockolate and promise-as3 don't work well together. Typically I will have a method which returns a Promise, however when running the test I get the following error:

D:\libs\adobe\flex\sdk\4.6\bin\adl.exe -profile extendedDesktop D:\testApp\out\test\desktop\_flexunit-descriptor.xml D:\testApp\out\test\desktop
Player connected; session starting.
[Fault] exception, information=VerifyError: Error #1053: Illegal override of TestInterface600C55060B003CF6CD88EB5CFE69DFE741318F03 in mockolate.generated.TestInterface600C55060B003CF6CD88EB5CFE69DFE741318F03

I've included the proof source which is sufficient:

TestInterface
package {
import com.codecatalyst.promise.Promise;
public interface TestInterface {
    function method() : void;
    function method2() : Promise;
}
}
MockPromiseTest
package {
import mockolate.runner.MockolateRule;
public class MockPromiseTest {
    [Rule]
    public var mocks : MockolateRule = new MockolateRule();
    [Mock]
    public var intrfc : TestInterface;

    [Test]
    public function test() : void {
    }
}
}

In the meantime I'll be making my own stubs however it would be nice to understand what is bothering mockolate (If you comment out method2 no errors occur).

Thanks in advance

mikecann commented 9 years ago

Did you ever get to the bottom of this? Im having issues with it too..

mikecann commented 9 years ago

I have located the problem and submitted a pull request, see my change above.