1require 'life'
2
3describe Game do
4 it 'should have a grid' do
5 # given
6 game = Game.new(5, 5)
7
8 # then
9 game.grid.should be_kind_of(Grid)
10 end
11
12 it 'should create a cell' do
13 # given
14 game = Game.new(2, 2)
15 expected_grid = Grid.from_string( 'X. ..' )
16
17 # when
18 game.create_at(0, 0)
19
20 # then
21 game.grid.should == expected_grid
22 end
23
24 it 'should destroy a cell' do
25 # given
26 game = Game.new(2,2)
27 game.grid = Grid.from_string('X. ..')
28
29 # when
30 game.destroy_at(0,0)
31
32 # then
33 game.grid.should == Grid.from_string('.. ..')
34 end
35end