New tests for #proxyTestStubs global function
This commit is contained in:
parent
2b79e04e14
commit
2ad461f3c6
|
@ -23,7 +23,7 @@
|
|||
return 2.5.fromScale(1, 10).toScale(1, 20).should.be.equal(5);
|
||||
});
|
||||
});
|
||||
return describe("#proxyFunctionsToObject", function() {
|
||||
describe("#proxyFunctionsToObject", function() {
|
||||
var ProxyClass, TestClass, methods;
|
||||
methods = ['asString', 'toString', 'returnString'];
|
||||
ProxyClass = (function() {
|
||||
|
@ -73,6 +73,25 @@
|
|||
return testclass.returnString("testString").should.be.equal("testString");
|
||||
});
|
||||
});
|
||||
return describe("#proxyTestStubs", function() {
|
||||
it("proxies methods to an object's commandList", function() {
|
||||
var base, methods;
|
||||
methods = ["hello", "goodbye"];
|
||||
base = {
|
||||
commandList: []
|
||||
};
|
||||
proxyTestStubs(methods, base);
|
||||
return expect(base.commandList).to.be.eql(methods);
|
||||
});
|
||||
return it("returns the object methods have been proxied to", function() {
|
||||
var base, methods;
|
||||
methods = ["hello", "goodbye"];
|
||||
base = {
|
||||
commandList: []
|
||||
};
|
||||
return expect(proxyTestStubs(methods, base)).to.be.eql(base);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
|
|
|
@ -52,3 +52,17 @@ describe "Utils", ->
|
|||
testclass = new TestClass
|
||||
assert typeof testclass.returnString is 'function'
|
||||
testclass.returnString("testString").should.be.equal "testString"
|
||||
|
||||
describe "#proxyTestStubs", ->
|
||||
it "proxies methods to an object's commandList", ->
|
||||
methods = ["hello", "goodbye"]
|
||||
base = {commandList: []}
|
||||
|
||||
proxyTestStubs methods, base
|
||||
expect(base.commandList).to.be.eql methods
|
||||
|
||||
it "returns the object methods have been proxied to", ->
|
||||
methods = ["hello", "goodbye"]
|
||||
base = {commandList: []}
|
||||
|
||||
expect(proxyTestStubs(methods, base)).to.be.eql base
|
||||
|
|
Loading…
Reference in New Issue