1require File.join(File.dirname(__FILE__), *%w[helper])
2
3Story "I can create a cell",
4 %(As a game producer
5 I want to create a cell
6 So that I can show the grid to people), :steps_for => :life do
7
8 Scenario "nothing to see here" do
9 Given "a game with dimensions", 3, 3 do |rows,cols|
10 @game = Game.new(rows,cols)
11 end
12
13 Then "the grid should look like", %(
14 ...
15 ...
16 ...
17 )
18 end
19
20 Scenario "all on its lonesome" do
21 Given "a game with dimensions", 2, 2
22 When "I create a cell at", 1, 1 do |row,col|
23 @game.create_at(row,col)
24 end
25 Then "the grid should look like", %(
26 ..
27 .X
28 )
29 end
30
31 Scenario "the grid has three cells" do
32 Given "a game with dimensions", 3, 3
33 When "I create a cell at", 0, 0
34 When "I create a cell at", 0, 1
35 When "I create a cell at", 2, 2
36 Then "the grid should look like", %(
37 XX.
38 ...
39 ..X
40 )
41 end
42
43 Scenario "more cells more more" do
44 GivenScenario "the grid has three cells"
45 When "I create a cell at", 2, 0
46 Then "the grid should look like", %(
47 XX.
48 ...
49 X.X
50 )
51 end
52end