Comparing version 0.1.8 to 0.1.9
{ | ||
"name": "a", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "title": "a", |
@@ -6,3 +6,4 @@ function setExecute(returnValue,hasCorrectArguments,mockContext,times) { | ||
var negotiateIncrementExpectCount = require('./negotiateIncrementExpectCount'); | ||
var emptyAnd = require('../newMutableAnd')(); | ||
and = and.add(mockContext.compositeAreCorrectArguments); | ||
@@ -15,4 +16,5 @@ and = and.add(trueNTimesThenFalse); | ||
negotiateIncrementExpectCount(times,mockContext); | ||
mockContext.compositeAreCorrectArguments = emptyAnd; | ||
} | ||
module.exports = setExecute; |
@@ -9,3 +9,5 @@ var assert = require('assert'); | ||
var negotiateIncrementExpectCount = newRequireMock('./negotiateIncrementExpectCount'); | ||
var newMutableAnd = newRequireMock('../newMutableAnd') | ||
var mutableAnd = {}; | ||
newMutableAnd.expect().return(mutableAnd); | ||
var sut = require('../setExecute'); | ||
@@ -86,2 +88,7 @@ | ||
it('should set mockContext.compositeAreCorrectArguments to empty mutable And',function() { | ||
assert.equal(mutableAnd,mockContext.compositeAreCorrectArguments); | ||
}); | ||
}); |
@@ -16,2 +16,16 @@ var assert = require('assert'); | ||
it('should return expected given stubbed twice',function() { | ||
var arg = 'a'; | ||
var arg2 = 'b'; | ||
var expected = {}; | ||
var expected2 = {}; | ||
var sut = newSut(fallback); | ||
sut.expect(arg).return(expected); | ||
sut.expect(arg2).return(expected2); | ||
var returned = sut(arg); | ||
var returned2 = sut(arg2); | ||
assert.equal(returned,expected); | ||
assert.equal(returned2,expected2); | ||
}); | ||
it('should return expected for correct arg',function() { | ||
@@ -18,0 +32,0 @@ var arg = 'a'; |
117661
139
3462