fix test to pass when criteria met

This commit is contained in:
zdenkers 2020-11-11 13:23:50 -07:00
parent 8800aedc83
commit 8bf91ebe59
4 changed files with 4 additions and 18 deletions

View File

@ -1,2 +0,0 @@
--colour
--format documentation

View File

@ -1,13 +0,0 @@
require File.join(File.dirname(__FILE__), 'gilded_rose')
describe GildedRose do
describe "#update_quality" do
it "does not change the name" do
items = [Item.new("foo", 0, 0)]
GildedRose.new(items).update_quality()
expect(items[0].name).to eq "fixme"
end
end
end

View File

@ -18,14 +18,14 @@ class TestGildedRoseRefactor < Test::Unit::TestCase
def test_foo
gilded_rose = GildedRose.new @items
string = "OMGHAI!\n"
(0...30).each do |day|
string = "OMGHAI!\n".force_encoding('UTF-8')
(0...31).each do |day|
string << "-------- day #{day} --------\n"
string << "name, sellIn, quality\n"
@items.each { |item| string << item.to_s + "\n" }
string << "\n"
gilded_rose.update_quality
end
assert_equal string, File.read('test_text_fixture.txt')
assert_equal string.force_encoding('UTF-8'), File.read('test_text_fixture.txt').force_encoding('UTF-8')
end
end

View File

@ -370,3 +370,4 @@ Backstage passes to a TAFKAL80ETC concert, -15, 0
Backstage passes to a TAFKAL80ETC concert, -20, 0
Backstage passes to a TAFKAL80ETC concert, -25, 0
Conjured Mana Cake, -27, 0