Skip to content

Instantly share code, notes, and snippets.

@kulte
Last active December 11, 2015 07:29
Show Gist options
  • Save kulte/4567012 to your computer and use it in GitHub Desktop.
Save kulte/4567012 to your computer and use it in GitHub Desktop.
describe('isWinner', function () {
var COMPUTER = 1;
var HUMAN = 2;
it('should return COMPUTER if the computer has won', function () {
var state = [1, 1, 1, -1, -1, -1, -1, 2, 2];
var board = new Board(state);
assert.equal(board.isWinner(), COMPUTER); /* assertion passes */
})
it('should return HUMAN if the human has won', function () {
var state = [-1, 1, 1, -1, -1, -1, 2, 2, 2];
var board = new Board(state);
assert.equal(board.isWinner(), HUMAN); /* assertion fails */
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment