Merge pull request #417 from richardTowers/sinon-mock

Sinon mock's should return `SinonExpectation`s, not `SinonExpectationStatic`s
This commit is contained in:
Diullei Gomes
2013-03-25 08:44:37 -07:00
2 changed files with 10 additions and 2 deletions

View File

@@ -142,7 +142,7 @@ interface SinonExpectationStatic {
}
interface SinonMock {
expects(method: string): SinonExpectationStatic;
expects(method: string): SinonExpectation;
restore(): void;
verify(): void;
}

View File

@@ -69,9 +69,17 @@ function testSix() {
stub.restore();
}
function testSeven() {
var obj = { functionToTest : function () { } };
var mockObj = sinon.mock(obj);
obj.functionToTest();
mockObj.expects('functionToTest').once();
}
testOne();
testTwo();
testThree();
testFour();
testFive();
testSix();
testSix();
testSeven();