Skip to content

Commit

Permalink
added single test for _pull
Browse files Browse the repository at this point in the history
  • Loading branch information
dskoda1 committed Sep 22, 2016
1 parent 71828be commit faaed8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Deck.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ class Deck {
return this._pull(Array.prototype.removeRandom, n);
}


// Internal method: called with an Array.prototype method,
// and a number of cards to remove.
_pull(arrMethod, n) {
if (n === undefined) {
n = 1;
Expand Down
6 changes: 6 additions & 0 deletions test/Deck-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ describe('Deck', () => {
});
});
})
describe('Deck._pull()', () => {
it('Will fail if called without a function for the first argument', () => {
let deck = new Deck();
expect(() => {deck._pull()}).to.throw();
})
})
//////////////////////////////////////////////////////////////////////////
describe('Deck.shuffle()', () => {
let original_shuffle;
Expand Down

0 comments on commit faaed8c

Please sign in to comment.