mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-17 19:35:06 +00:00
updated these versions to more closely match the original C#
This commit is contained in:
1 parent
2e3386ab13
commit
4dab932c94
4 files changed
+44
-37
No files matched your search
@@ -1,7 +1,11 @@
|
||||
|
||||
class GildedRose
|
||||
def update_quality(items)
|
||||
items.each do |item|
|
||||
def initialize(items)
|
||||
@items = items
|
||||
end
|
||||
|
||||
def update_quality()
|
||||
@items.each do |item|
|
||||
if item.name != "Aged Brie" and item.name != "Backstage passes to a TAFKAL80ETC concert"
|
||||
if item.quality > 0
|
||||
if item.name != "Sulfuras, Hand of Ragnaros"
|
||||
@@ -46,7 +50,6 @@ class GildedRose
|
||||
end
|
||||
end
|
||||
end
|
||||
items
|
||||
end
|
||||
end
|
||||
|
||||
@@ -62,4 +65,4 @@ class Item
|
||||
def to_s()
|
||||
"#{@name}, #{@sell_in}, #{@quality}"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -5,7 +5,7 @@ describe GildedRose do
|
||||
describe "#update_quality" do
|
||||
it "does not change the name" do
|
||||
items = [Item.new("foo", 0, 0)]
|
||||
GildedRose.new().update_quality(items)
|
||||
GildedRose.new(items).update_quality()
|
||||
items[0].name.should == "fixme"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user