Created
August 18, 2018 19:50
-
-
Save tmikeschu/4b61794c3134ec864a522bf37cbc2053 to your computer and use it in GitHub Desktop.
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
// cat, spaceship, plum | |
// jump | |
// hash/object | |
describe("cat.jump", () => { | |
let spaceship | |
let cat | |
before(() => { | |
spaceship = createSpaceshipWithPlums() | |
cat = createCat({ spaceship }) | |
}) | |
it("causes a spaceship to drop a plum", () => { | |
// we forgot to use the object data type, so I switched spaceship.plums to spaceship.supples, | |
// which would have keys of supply types pointing to quantity (maybe?!) | |
const suppliesBefore = spaceship.supplies | |
cat.jump | |
const suppliesAfter = spaceship.supplies | |
const actual = suppliesBefore.plums - suppliesAfter.plums | |
const expected = 1 | |
expect(actual).toEqual(expected) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment