Last active
June 30, 2024 14:32
-
-
Save trikitrok/6811113bdab5dec9e0b0 to your computer and use it in GitHub Desktop.
Conway's rules tests better names
This file contains hidden or 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("rules", function() { | |
describe("rule to go on living", function() { | |
it("does't go on living because of overpopulation", function() { | |
expect(rules.goesOnLivingWith(4)).toBe(false); | |
}); | |
it("does't go on living because of underpopulation", function() { | |
expect(rules.goesOnLivingWith(1)).toBe(false); | |
}); | |
it("goes on living", function() { | |
expect(rules.goesOnLivingWith(3)).toBe(true); | |
expect(rules.goesOnLivingWith(2)).toBe(true); | |
}); | |
}); | |
describe("rule to be created", function() { | |
it("has enough neighbors to be created", function () { | |
expect(rules.isCreatedWith(3)).toBe(true); | |
}); | |
it("has not enough neighbors to be created", function () { | |
expect(rules.isCreatedWith(1)).toBe(false); | |
}); | |
it("has too many neighbors to be created", function () { | |
expect(rules.isCreatedWith(4)).toBe(false); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment