Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. describe('Any live cell with two or three live neighbours lives on to the next generation.', function () {
  2.  
  3. it('should save cell with two live neighbours', function () {
  4. game.setCell(3,2);
  5. game.setCell(3,4);
  6.  
  7. game.setCell(3,3);
  8. game.nextFrame();
  9. expect(game.grid()[3][3]).toBe(1);
  10. });
  11.  
  12. it('should save cell with three live neighbours', function () {
  13. game.setCell(3,2);
  14. game.setCell(3,4);
  15. game.setCell(4,4);
  16.  
  17. game.setCell(3,3);
  18. game.nextFrame();
  19. expect(game.grid()[3][3]).toBe(1);
  20. });
  21.  
  22. it('should save cell with three live neighbours on different rows', function () {
  23. game.setCell(2,2);
  24. game.setCell(3,4);
  25. game.setCell(4,4);
  26.  
  27. game.setCell(3,3);
  28. game.nextFrame();
  29. expect(game.grid()[3][3]).toBe(1);
  30. });
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement