Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

A couple of bug fixes #12

Merged
merged 2 commits into from

2 participants

@andreyvit

Hey! Two unrelated bug fixes — I'm sorry to provide them in a single pull request, but they are really small, and the commit messages explain the problems.

@felixge felixge merged commit 766c4ec into felixge:master
@felixge
Owner

Thanks, sorry for delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 20, 2012
  1. @andreyvit
Commits on Apr 9, 2012
  1. @andreyvit
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/gently/gently.js
View
4 lib/gently/gently.js
@@ -115,6 +115,8 @@ Gently.prototype.verify = function(msg) {
}
}
+ this.expectations = []; // reset so that no duplicate verification attempts are made
+
if (!validExpectations.length) {
return;
}
@@ -147,7 +149,7 @@ Gently.prototype._stubFn = function(self, obj, method, name, args) {
// autorestore original if its not a closure
// and no more expectations on that object
- has_more_expectations = this.expectations.reduce(function (memo, expectation) {
+ var has_more_expectations = this.expectations.reduce(function (memo, expectation) {
return memo || (expectation.obj === obj && expectation.method === method);
}, false);
if (obj !== null && method !== null && !has_more_expectations) {
Something went wrong with that request. Please try again.