Permalink
Browse files

Fixed bug after changing variable name

  • Loading branch information...
1 parent 76d3952 commit b6651ad41f18c7b95b2a7e1da1dd716415d65ee5 @vlucas committed Apr 25, 2012
Showing with 10 additions and 10 deletions.
  1. +9 −9 lib/frisby.js
  2. +1 −1 package.json
View
@@ -506,12 +506,12 @@ Frisby.prototype.expectJSON = function(jsonTest) {
// Helper to check parse HTTP response body as JSON and check array or object length
-Frisby.prototype.expectJSONLength = function(jsonTest) {
- var self = this,
- args = Array.prototype.slice.call(arguments),
- path = typeof args[0] === 'string' && args.shift(),
- jsonTest = typeof args[0] === 'number' && args.shift(),
- type = null;
+Frisby.prototype.expectJSONLength = function(expectedLength) {
+ var self = this,
+ args = Array.prototype.slice.call(arguments),
+ path = typeof args[0] === 'string' && args.shift(),
+ expectedLength = typeof args[0] === 'number' && args.shift(),
+ type = null;
this.current.expects.push(function() {
var jsonBody = _jsonParse(self.current.response.body);
@@ -535,7 +535,7 @@ Frisby.prototype.expectJSONLength = function(jsonTest) {
}
// Generate useful error message if values don't match
- if(len !== jsonTest) {
+ if(len !== expectedLength) {
throw new Error("Expected JSON length to be '" + expectedLength + "', got '" + len + "'" + (path ? (" in path '" + path + "'") : ""));
}
});
@@ -753,7 +753,7 @@ beforeEach(function() {
this.message = function() {
return "Actual JSON did not match expected";
}
-
+
// Way of allowing custom failure message - by thowing expections in utility function
try {
return _jsonContains(this.actual, expected);
@@ -920,4 +920,4 @@ exports.toss = exports.create;
// Public methods and properties
exports.globalSetup = globalSetup;
-exports.version = '0.4.3';
+exports.version = '0.4.4';
View
@@ -1,6 +1,6 @@
{
"name" : "frisby"
-, "version" : "0.4.3"
+, "version" : "0.4.4"
, "description" : "REST API Endpoint Testing built on Jasmine"
, "homepage" : ""
, "author" : "Vance Lucas <vance@vancelucas.com>"

0 comments on commit b6651ad

Please sign in to comment.