Created
April 7, 2015 00:27
-
-
Save excid3/409e131f2c8661540172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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