Skip to content

Instantly share code, notes, and snippets.

@superchris
Created June 15, 2012 19:37
Show Gist options
  • Save superchris/2938353 to your computer and use it in GitHub Desktop.
Save superchris/2938353 to your computer and use it in GitHub Desktop.
bowling kata
describe "bowling", ->
beforeEach ->
@game = new Game
describe "no spare or strike", ->
beforeEach ->
@game.roll(3)
@game.roll(4)
@game.roll(7)
it "should calculate the score", ->
expect(@game.score()).toEqual 14
describe "with a spare", ->
beforeEach ->
@game.roll(6)
@game.roll(4)
@game.roll(7)
it "should add the next roll after spare", ->
expect(@game.score()).toEqual 24
describe "bowling", ->
beforeEach ->
@game = new Game
describe "no spare or strike", ->
beforeEach ->
@game.roll(3)
@game.roll(4)
@game.roll(7)
it "should calculate the score", ->
expect(@game.score()).toEqual 14
describe "with a spare", ->
beforeEach ->
@game.roll(6)
@game.roll(4)
@game.roll(7)
it "should add the next roll after spare", ->
expect(@game.score()).toEqual 24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment