All Files
(97.22%
covered at
25.2
hits/line)
1 files in total.
36 relevant lines.
35 lines covered and
1 lines missed
File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
gilded_rose.rb |
97.22 % |
65 |
36 |
35 |
1 |
25.2 |
-
-
1
class GildedRose
-
1
def update_quality(items)
-
16
items.each do |item|
-
112
if item.name != "Aged Brie" and item.name != "Backstage passes to a TAFKAL80ETC concert"
-
64
if item.quality > 0
-
37
if item.name != "Sulfuras, Hand of Ragnaros"
-
21
item.quality = item.quality - 1
-
end
-
end
-
else
-
48
if item.quality < 50
-
17
item.quality = item.quality + 1
-
17
if item.name == "Backstage passes to a TAFKAL80ETC concert"
-
16
if item.sell_in < 11
-
10
if item.quality < 50
-
10
item.quality = item.quality + 1
-
end
-
end
-
16
if item.sell_in < 6
-
5
if item.quality < 50
-
5
item.quality = item.quality + 1
-
end
-
end
-
end
-
end
-
end
-
112
if item.name != "Sulfuras, Hand of Ragnaros"
-
80
item.sell_in = item.sell_in - 1
-
end
-
112
if item.sell_in < 0
-
51
if item.name != "Aged Brie"
-
35
if item.name != "Backstage passes to a TAFKAL80ETC concert"
-
33
if item.quality > 0
-
22
if item.name != "Sulfuras, Hand of Ragnaros"
-
6
item.quality = item.quality - 1
-
end
-
end
-
else
-
2
item.quality = item.quality - item.quality
-
end
-
else
-
16
if item.quality < 50
-
1
item.quality = item.quality + 1
-
end
-
end
-
end
-
end
-
16
items
-
end
-
end
-
-
1
class Item
-
1
attr_accessor :name, :sell_in, :quality
-
-
1
def initialize(name, sell_in, quality)
-
7
@name = name
-
7
@sell_in = sell_in
-
7
@quality = quality
-
end
-
-
1
def to_s()
-
"#{@name}, #{@sell_in}, #{@quality}"
-
end
-
end