aboutsummaryrefslogtreecommitdiffstats
path: root/spec/board_spec.rb
blob: 1370c10a8d58bfb37da4869ddc421a3fd2b1a1da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'spec_helper'

describe Board do
  before do
    @board = Board.new
  end
  
  describe '#render' do
    it 'prints a grid' do
      out, err = capture_io do
        @board.render
      end
      
      out.must_equal <<EOF
...
...
...
EOF
    end
    
    it 'starts with a grid of dots' do
      @board.instance_variable_get('@board').must_equal [
        ['.', '.', '.'],
        ['.', '.', '.'],
        ['.', '.', '.']
      ]
    end
  end
end