Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
  • Loading branch information
dvonlehman committed Mar 8, 2016
2 parents 3c5611d + 0aba472 commit 130ef18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Expand Up @@ -44,6 +44,9 @@ assert.noDifferences = function(array, otherArray) {
if (!(_.isArray(array) && _.isArray(otherArray)))
throw new Error("Both arguments must be arrays");

if (array.length !== otherArray.length)
throw new assert.AssertionError({message: "Arrays are not the same length"});

if (_.difference(array, otherArray).length > 0)
throw new assert.AssertionError({message: "Arrays have differences"});
};
Expand Down
4 changes: 4 additions & 0 deletions test/assert.js
Expand Up @@ -63,6 +63,10 @@ describe('dash-assert', function() {
assert.throws(function() {
assert.noDifferences([1, 2, 3], [2, 3, 4]);
});

assert.throws(function() {
assert.noDifferences([], [1, 2, 3]);
});
});

it('hasIntersect', function() {
Expand Down

0 comments on commit 130ef18

Please sign in to comment.