Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make the source more readable

Specifically adding some source comments on the the different
interfaces supported by gently.expect()
  • Loading branch information...
commit d6947206fe66602ff9d71a4e8f00a871f84cc5d0 1 parent a1186b5
@felixge authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/gently/gently.js
View
4 lib/gently/gently.js
@@ -14,19 +14,23 @@ Gently.prototype.toString = function() {
Gently.prototype.expect = function(obj, method, count, mock) {
var name;
if (typeof obj == 'function') {
+ // expect(mock) interface
mock = obj;
obj = null;
method = null;
count = 1;
} else if (typeof method == 'function') {
+ // expect(count, mock) interface
count = obj;
mock = method;
obj = null;
method = null;
} else if (typeof count == 'function') {
+ // expect(obj, method, mock) interface
mock = count;
count = 1;
} else if (count === undefined) {
+ // expect(obj, method) interface
count = 1;
}
Please sign in to comment.
Something went wrong with that request. Please try again.