public
Created

Full example

  • Download Gist
example_spec.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.