mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
actually fixed special item this time, feature tests also fixed
This commit is contained in:
parent
89fb0d8689
commit
3773a972aa
@ -6,7 +6,7 @@ class GildedRose
|
||||
|
||||
def self.update_quality(items)
|
||||
items.map do |item|
|
||||
if item.name != "Aged Brie" and item.name != "Backstage passes to a TAFKAL80ETC concert"
|
||||
if !special_item?(item)
|
||||
|
||||
update_normal_quality(item) if !sulfuras?(item)
|
||||
|
||||
@ -68,7 +68,7 @@ class GildedRose
|
||||
end
|
||||
|
||||
def self.special_item?(item)
|
||||
item.name.downcase.match( /Aged Brie/ || /backstage/).nil? || sulfuras?(item)
|
||||
( !item.name.downcase.match( /aged brie/).nil? || !item.name.downcase.match(/backstage/).nil? || sulfuras?(item))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ let(:sulfarus) { Item.new('Sulfuras, Hand of Ragnaros', 50, 80) }
|
||||
|
||||
it 'returns false on potato' do
|
||||
item_double = double :item, name: "potato"
|
||||
expect(GildedRose.sulfuras?(item_double)).to eq false
|
||||
expect(GildedRose.special_item?(item_double)).to eq false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user