Skip to content
Browse files

Changed spec givens to use the term initial.

  • Loading branch information...
1 parent 4e7513a commit e073894f8ccb9efda6f48aedcdd4c7a3755c8855 @jimweirich jimweirich committed Feb 16, 2011
Showing with 82 additions and 82 deletions.
  1. +82 −82 gilded_rose_spec.rb
View
164 gilded_rose_spec.rb
@@ -4,34 +4,34 @@
describe "#update_quality" do
context "with a single" do
- Given(:sell_in) { 5 }
- Given(:quality) { 10 }
- Given(:item) { Item.new(name, sell_in, quality) }
+ Given(:initial_sell_in) { 5 }
+ Given(:initial_quality) { 10 }
+ Given(:item) { Item.new(name, initial_sell_in, initial_quality) }
When { update_quality([item]) }
context "normal item" do
Given(:name) { "NORMAL ITEM" }
context "before sell date" do
- Then { item.quality.should == quality-1 }
- Then { item.sell_in.should == sell_in-1 }
+ Then { item.quality.should == initial_quality-1 }
+ Then { item.sell_in.should == initial_sell_in-1 }
end
context "on sell date" do
- Given(:sell_in) { 0 }
- Then { item.quality.should == quality-2 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { 0 }
+ Then { item.quality.should == initial_quality-2 }
+ Then { item.sell_in.should == initial_sell_in-1 }
end
context "after sell date" do
- Given(:sell_in) { -10 }
- Then { item.quality.should == quality-2 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { -10 }
+ Then { item.quality.should == initial_quality-2 }
+ Then { item.sell_in.should == initial_sell_in-1 }
end
context "of zero quality" do
- Given(:quality) { 0 }
+ Given(:initial_quality) { 0 }
Then { item.quality.should == 0 }
end
end
@@ -40,131 +40,131 @@
Given(:name) { "Aged Brie" }
context "before sell date" do
- Then { item.quality.should == quality+1 }
- Then { item.sell_in.should == sell_in-1 }
+ Then { item.quality.should == initial_quality+1 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "with max quality" do
- Given(:quality) { 50 }
- Then { item.quality.should == quality }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_quality) { 50 }
+ Then { item.quality.should == initial_quality }
+ Then { item.sell_in.should == initial_sell_in-1 }
end
end
context "on sell date" do
- Given(:sell_in) { 0 }
- Then { item.quality.should == quality+2 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { 0 }
+ Then { item.quality.should == initial_quality+2 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "with max quality" do
- Given(:quality) { 50 }
- Then { item.quality.should == quality }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_quality) { 50 }
+ Then { item.quality.should == initial_quality }
+ Then { item.sell_in.should == initial_sell_in-1 }
end
end
context "after sell date" do
- Given(:sell_in) { -10 }
- Then { item.quality.should == quality+2 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { -10 }
+ Then { item.quality.should == initial_quality+2 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "with max quality" do
- Given(:quality) { 50 }
- Then { item.quality.should == quality }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_quality) { 50 }
+ Then { item.quality.should == initial_quality }
+ Then { item.sell_in.should == initial_sell_in-1 }
end
end
end
context "Sulfuras" do
- Given(:quality) { 80 }
+ Given(:initial_quality) { 80 }
Given(:name) { "Sulfuras, Hand of Ragnaros" }
context "before sell date" do
- Then { item.quality.should == quality }
- Then { item.sell_in.should == sell_in }
+ Then { item.quality.should == initial_quality }
+ Then { item.sell_in.should == initial_sell_in }
end
context "on sell date" do
- Given(:sell_in) { 0 }
- Then { item.quality.should == quality }
- Then { item.sell_in.should == sell_in }
+ Given(:initial_sell_in) { 0 }
+ Then { item.quality.should == initial_quality }
+ Then { item.sell_in.should == initial_sell_in }
end
context "after sell date" do
- Given(:sell_in) { -10 }
- Then { item.quality.should == quality }
- Then { item.sell_in.should == sell_in }
+ Given(:initial_sell_in) { -10 }
+ Then { item.quality.should == initial_quality }
+ Then { item.sell_in.should == initial_sell_in }
end
end
context "Backstage pass" do
Given(:name) { "Backstage passes to a TAFKAL80ETC concert" }
context "long before sell date" do
- Given(:sell_in) { 11 }
- Then { item.quality.should == quality+1 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { 11 }
+ Then { item.quality.should == initial_quality+1 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "at max quality" do
- Given(:quality) { 50 }
- Then { item.quality.should == quality }
+ Given(:initial_quality) { 50 }
+ Then { item.quality.should == initial_quality }
end
end
context "medium close to sell date (upper bound)" do
- Given(:sell_in) { 10 }
- Then { item.quality.should == quality+2 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { 10 }
+ Then { item.quality.should == initial_quality+2 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "at max quality" do
- Given(:quality) { 50 }
- Then { item.quality.should == quality }
+ Given(:initial_quality) { 50 }
+ Then { item.quality.should == initial_quality }
end
end
context "medium close to sell date (lower bound)" do
- Given(:sell_in) { 6 }
- Then { item.quality.should == quality+2 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { 6 }
+ Then { item.quality.should == initial_quality+2 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "at max quality" do
- Given(:quality) { 50 }
- Then { item.quality.should == quality }
+ Given(:initial_quality) { 50 }
+ Then { item.quality.should == initial_quality }
end
end
context "very close to sell date (upper bound)" do
- Given(:sell_in) { 5 }
- Then { item.quality.should == quality+3 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { 5 }
+ Then { item.quality.should == initial_quality+3 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "at max quality" do
- Given(:quality) { 50 }
- Then { item.quality.should == quality }
+ Given(:initial_quality) { 50 }
+ Then { item.quality.should == initial_quality }
end
end
context "very close to sell date (lower bound)" do
- Given(:sell_in) { 1 }
- Then { item.quality.should == quality+3 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { 1 }
+ Then { item.quality.should == initial_quality+3 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "at max quality" do
- Given(:quality) { 50 }
- Then { item.quality.should == quality }
+ Given(:initial_quality) { 50 }
+ Then { item.quality.should == initial_quality }
end
end
context "on sell date" do
- Given(:sell_in) { 0 }
+ Given(:initial_sell_in) { 0 }
Then { item.quality.should == 0 }
- Then { item.sell_in.should == sell_in-1 }
+ Then { item.sell_in.should == initial_sell_in-1 }
end
context "after sell date" do
- Given(:sell_in) { -10 }
+ Given(:initial_sell_in) { -10 }
Then { item.quality.should == 0 }
- Then { item.sell_in.should == sell_in-1 }
+ Then { item.sell_in.should == initial_sell_in-1 }
end
end
@@ -173,35 +173,35 @@
Given(:name) { "Conjured Mana Cake" }
context "before the sell date" do
- Given(:sell_in) { 5 }
- Then { item.quality.should == quality-2 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { 5 }
+ Then { item.quality.should == initial_quality-2 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "at zero quality" do
- Given(:quality) { 0 }
- Then { item.quality.should == quality }
+ Given(:initial_quality) { 0 }
+ Then { item.quality.should == initial_quality }
end
end
context "on sell date" do
- Given(:sell_in) { 0 }
- Then { item.quality.should == quality-2 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { 0 }
+ Then { item.quality.should == initial_quality-2 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "at zero quality" do
- Given(:quality) { 0 }
- Then { item.quality.should == quality }
+ Given(:initial_quality) { 0 }
+ Then { item.quality.should == initial_quality }
end
end
context "after sell date" do
- Given(:sell_in) { -10 }
- Then { item.quality.should == quality-2 }
- Then { item.sell_in.should == sell_in-1 }
+ Given(:initial_sell_in) { -10 }
+ Then { item.quality.should == initial_quality-2 }
+ Then { item.sell_in.should == initial_sell_in-1 }
context "at zero quality" do
- Given(:quality) { 0 }
- Then { item.quality.should == quality }
+ Given(:initial_quality) { 0 }
+ Then { item.quality.should == initial_quality }
end
end
end

0 comments on commit e073894

Please sign in to comment.
Something went wrong with that request. Please try again.