diff --git a/ruby/gilded_rose_spec.rb b/ruby/gilded_rose_spec.rb index 70c83053b5..76e49c3709 100644 --- a/ruby/gilded_rose_spec.rb +++ b/ruby/gilded_rose_spec.rb @@ -10,44 +10,44 @@ end context 'para items normales' do - setup do + before do ## Arrange - items = [Item.new("foo", 10, 2)] - gilded = GildedRose.new(items) + @items = [Item.new("foo", 10, 2)] + @gilded = GildedRose.new(@items) end it 'decrementa la calidad del item' do #Act - gilded.update_quality() + @gilded.update_quality() #Assert - expect(items[0].quality).to eq 1 + expect(@items[0].quality).to eq 1 end it 'decrementa los dias para vender el item' do #Act - gilded.update_quality() + @gilded.update_quality() #Assert - expect(items[0].sell_in).to eq 9 + expect(@items[0].sell_in).to eq 9 end it 'decrementa la calidad del item al doble de velocidad cuando ya no quedan dias para venderlo' do - items[0].sell_in = 0 - items[0].quality = 20 + @items[0].sell_in = 0 + @items[0].quality = 20 - gilded.update_quality() + @gilded.update_quality() - expect(items[0].quality).to eq 18 + expect(@items[0].quality).to eq 18 end it 'no decrementa la calidad del item a negativo' do - items[0].quality = 0 + @items[0].quality = 0 - gilded.update_quality() + @gilded.update_quality() - expect(items[0].quality).to eq 0 + expect(@items[0].quality).to eq 0 end end