drewbourne / mockolate

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

Add constructor overrides for special cases like NetStream #48

Open drewbourne opened 13 years ago

drewbourne commented 13 years ago

Something like:

mocks.addConstructorOverrideFor(NetStream, function(netStreamClass:Class, constructorArgs:Array):NetStream {
    var netConnection:NetConnection = new NetConnection();
    netConnection.connect(null);
    return new netStreamClass(netConnection)
});