Skip to content

Instantly share code, notes, and snippets.

@excid3
Created April 7, 2015 00:27
Show Gist options
  • Save excid3/409e131f2c8661540172 to your computer and use it in GitHub Desktop.
Save excid3/409e131f2c8661540172 to your computer and use it in GitHub Desktop.
describe Cell do
it "can be created" do
expect(Cell.new).to_not eq(nil)
end
it "can tick" do
cell = Cell.new
expect(cell).to respond_to(:tick!)
end
it "has neighbors" do
cell = Cell.new
expect(cell).to respond_to(:neighbors)
end
it "knows if it is alive" do
cell = Cell.new
expect(cell).to respond_to(:alive?)
end
it "dies if it has less than two neighbors" do
cell = Cell.new neighbors: 1
cell.tick!
expect(cell.alive?).to be_falsey
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment