Skip to content

Commit

Permalink
[test] Adding .deep and .string/type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
3rd-Eden committed Dec 19, 2014
1 parent 3230a0d commit 32cd1e5
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,20 @@ describe('Assertions', function assertions() {
}
}
});

it('supports .deep', function (next) {
assume([1]).deep.equals([1]);

try { assume([1]).equals([1]); }
catch (e) { next(); }
});

it('supports .not', function (next) {
assume('foo').does.not.equal('bar');

try { assume('foo').does.not.equal('foo'); }
catch (e) { next(); }
});
});

describe('#eql', function () {
Expand Down Expand Up @@ -657,6 +671,16 @@ describe('Assertions', function assertions() {
next();
});

it('still allows error in the callback', function (done) {
var next = assume.plan(2, function (err) {
assume(err.message).includes('shit');

done();
});

next(new Error('shit'));
});

it('throws when not supplied with a callback', function () {
var next = assume.plan(2);

Expand All @@ -674,6 +698,29 @@ describe('Assertions', function assertions() {
}
});
});

describe('type checks', function () {
it('.string', function (next) {
assume('function').is.string();

try { assume(true).is.string(); }
catch (e) { next(); }
});

it('.array', function (next) {
assume(['function']).is.array();

try { assume(true).is.array(); }
catch (e) { next(); }
});

it('is .arguments', function (next) {
assume(arguments).is.arguments();

try { assume(true).is.arguments(); }
catch (e) { next(); }
});
});
});

describe('i', function () {
Expand Down

0 comments on commit 32cd1e5

Please sign in to comment.