Skip to content

Commit

Permalink
Merge pull request JS-Challenges#39 from mybrainishuge/master
Browse files Browse the repository at this point in the history
Added check for sort method in mergeSort
  • Loading branch information
mybrainishuge committed Apr 11, 2016
2 parents 7993c6e + 29addc4 commit 2a551e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/part2.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
expect(sortedNumbers).to.eql([-15,-2,1,8,20]);
});

it("should not use the native Array sort method", function() {
expect(mergeSort.toString()).to.not.contain('sort');
});

it('should use recursion by calling self', function () {
var originalMergeSort = mergeSort;
mergeSort = sinon.spy(mergeSort);
Expand Down

0 comments on commit 2a551e8

Please sign in to comment.