public
Created

Non-invariant example

  • Download Gist
example_spec.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12
describe "taking one down" do
Given(:beers_on_the_wall){ BeersOnTheWall.new(beer_count) }
When{ beers_on_the_wall.take_one_down }
context "while we still have beers" do
Then{ expect(beers_on_the_wall.count).to eql (beer_count - 1) }
end
context "when all the beers have gone" do
Given(:beers_on_the_wall){ BeersOnTheWall.new(1) }
# or Given{ beers_on_the_wall.beers = 1 }
Then{ expect(beers_on_the_wall.count).to eql "no more bottles of beers on the wall"}
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.