actually fixed special item this time, feature tests also fixed

This commit is contained in:
ollie beney 2020-11-05 12:49:20 +00:00
parent 89fb0d8689
commit 3773a972aa
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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