Skip to content

Instantly share code, notes, and snippets.

@dtryon
Last active August 29, 2015 14:22
describe('Any live cell with fewer than two live neighbours dies, as if caused by under-population.', function () {
it('should kill cell with no live neighbours', function () {
game.setCell(3,3);
game.nextFrame();
expect(game.grid()[3][3]).toBe(0);
});
it('should kill cell with one live neighbour', function () {
game.setCell(3,2);
game.setCell(3,3);
game.nextFrame();
expect(game.grid()[3][3]).toBe(0);
});
it('should kill cell with one live neighbour in the previous row', function () {
game.setCell(2,2);
game.setCell(3,3);
game.nextFrame();
expect(game.grid()[3][3]).toBe(0);
});
it('should kill cell with one live neighbour in the next row', function () {
game.setCell(4,4);
game.setCell(3,3);
game.nextFrame();
expect(game.grid()[3][3]).toBe(0);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment