Sha256: cb1aa24d78073fef505d08f19cd6d258c85cb4f52f2e0043e34ed6e9864db369

Contents?: true

Size: 588 Bytes

Versions: 3

Compression:

Stored size: 588 Bytes

Contents

require 'life'

describe Game do
  it 'should have a grid' do
    # given
    game = Game.new(5, 5)

    # then
    game.grid.should be_kind_of(Grid)
  end

  it 'should create a cell' do
    # given
    game = Game.new(2, 2)
    expected_grid = Grid.from_string( 'X. ..' )

    # when
    game.create_at(0, 0)

    # then
    game.grid.should == expected_grid
  end

  it 'should destroy a cell' do
    # given
    game = Game.new(2,2)
    game.grid = Grid.from_string('X. ..')

    # when
    game.destroy_at(0,0)

    # then
    game.grid.should == Grid.from_string('.. ..')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picolena-0.1.6 rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb
picolena-0.1.7 rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb
picolena-0.1.8 rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb