Skip to content
Browse files

Added missing tests on backstage pass.

  • Loading branch information...
1 parent 4d993c3 commit 7c1db301f995d4067d6c9eb038a20b742055a7ed @jimweirich committed
Showing with 34 additions and 1 deletion.
  1. +34 −1 gilded_rose_spec.rb
View
35 gilded_rose_spec.rb
@@ -105,7 +105,7 @@
end
end
- context "closer to sell date" do
+ 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 }
@@ -116,6 +116,39 @@
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 }
+
+ context "at max quality" do
+ Given(:quality) { 50 }
+ Then { item.quality.should == 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 }
+
+ context "at max quality" do
+ Given(:quality) { 50 }
+ Then { item.quality.should == 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 }
+
+ context "at max quality" do
+ Given(:quality) { 50 }
+ Then { item.quality.should == quality }
+ end
+ end
+
context "on sell date" do
Given(:sell_in) { 0 }
Then { item.quality.should == 0 }

0 comments on commit 7c1db30

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