Last active
December 11, 2015 07:29
-
-
Save kulte/4567012 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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