Skip to content

Instantly share code, notes, and snippets.

@bangline
Created October 14, 2012 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bangline/3889903 to your computer and use it in GitHub Desktop.
Save bangline/3889903 to your computer and use it in GitHub Desktop.
Full example
describe BeersOnTheWall do
Given(:beer_count){ 50 }
describe "setting up the wall" do
context "when we are too drunk to count" do
Given(:beers){ BeersOnTheWall.new }
Then{ expect(beers.count).to eql 100}
end
context "when we aint even been drinking yet" do
Given(:beers){ BeersOnTheWall.new(beer_count) }
Then{ expect(beers.count).to eql beer_count}
end
end
describe "taking one down" do
Given(:beers_on_the_wall){ BeersOnTheWall.new(beer_count) }
When{ beers_on_the_wall.take_one_down }
Then{ expect(beers_on_the_wall.count).to eql (beer_count - 1) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment