Permalink
Browse files

Fixing JSCBC-25 test (previously would never fail)

Change-Id: I0f1748bf0b41c8f129629e04c88ce99d89d64008
Reviewed-on: http://review.couchbase.org/28997
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Brett Lawson <brett19@gmail.com>
  • Loading branch information...
1 parent d1b7015 commit 5c7eafa87a65405e10f2efa50c3e65ba4b04e894 @BryanDonovan BryanDonovan committed with brett19 Sep 16, 2013
Showing with 22 additions and 18 deletions.
  1. +22 −18 test/regressions.js
View
@@ -75,26 +75,30 @@ describe('#regressions', function() {
});
});
- it('JSCBC-25', function(done) {
- var cb = H.newClient();
-
- var keys = [[1,2,3],[4,6,3]];
- try {
- cb.get(keys, function (err, doc, meta) {
+ describe('JSCBC-25', function() {
+ context("when keys arg is a nested array", function() {
+ it("calls back with an error", function(done) {
+ var cb = H.newClient();
+
+ var keys = [[1, 2, 3], [4, 6, 3]];
+ cb.get(keys, function(err) {
+ assert.ok(err.message.match(/key is not a string/));
+ done();
+ });
});
- assert(false, "Invalid keys should throw exceptions");
- } catch (err) {
- }
+ });
- var keys = [1];
- try {
- cb.get(keys, function (err, doc, meta) {
- });
- assert(false, "Invalid keys should throw exceptions");
- } catch (err) {
- }
+ context("when keys arg is an array", function() {
+ it("calls back with an error", function(done) {
+ var cb = H.newClient();
- done();
+ var keys = [1];
+ cb.get(keys, function(err) {
+ assert.ok(err.message.match(/key is not a string/));
+ done();
+ });
+ });
+ });
});
-});
+});

0 comments on commit 5c7eafa

Please sign in to comment.