Navigation Menu

Skip to content

Commit

Permalink
fixed branch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nrstott committed Jan 27, 2012
1 parent 8f8b5e7 commit e56d562
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/middleware-branch.test.js
@@ -1,5 +1,5 @@
var bogart = require('../lib/bogart') var bogart = require('../lib/bogart')
, q = require("promised-io/lib/promise") , q = require('q')
, security = require("../lib/security") , security = require("../lib/security")
, util = require('util') , util = require('util')
, test = require('tap').test , test = require('tap').test
Expand All @@ -13,9 +13,8 @@ test('rejects with error "Empty chain" when called with an empty chain', functio


q.when(branch(mockRequest('/')), null, function(err) { q.when(branch(mockRequest('/')), null, function(err) {
t.equal(err.message, 'Empty chain'); t.equal(err.message, 'Empty chain');
}); t.end();

}).end();
t.plan(2);
}); });


test('should have ifTrue', function(t) { test('should have ifTrue', function(t) {
Expand All @@ -42,7 +41,7 @@ test('should follow ifTrue path', function(t) {
}); });


binary.ifTrue(function(req) { binary.ifTrue(function(req) {
t.ok(req); t.ok(req, 'Followed ifTrue path');
}); });


binary(mockRequest('/')); binary(mockRequest('/'));
Expand All @@ -56,7 +55,7 @@ test('should follow ifFalse path', function(t) {
}); });


binary.ifFalse(function(req) { binary.ifFalse(function(req) {
t.ok(req); t.ok(req, 'Followed ifFalse path');
}); });


binary(mockRequest('/')); binary(mockRequest('/'));
Expand Down

0 comments on commit e56d562

Please sign in to comment.