mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
fix test to pass when criteria met
This commit is contained in:
parent
8800aedc83
commit
8bf91ebe59
@ -1,2 +0,0 @@
|
|||||||
--colour
|
|
||||||
--format documentation
|
|
||||||
@ -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
|
|
||||||
@ -18,14 +18,14 @@ class TestGildedRoseRefactor < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_foo
|
def test_foo
|
||||||
gilded_rose = GildedRose.new @items
|
gilded_rose = GildedRose.new @items
|
||||||
string = "OMGHAI!\n"
|
string = "OMGHAI!\n".force_encoding('UTF-8')
|
||||||
(0...30).each do |day|
|
(0...31).each do |day|
|
||||||
string << "-------- day #{day} --------\n"
|
string << "-------- day #{day} --------\n"
|
||||||
string << "name, sellIn, quality\n"
|
string << "name, sellIn, quality\n"
|
||||||
@items.each { |item| string << item.to_s + "\n" }
|
@items.each { |item| string << item.to_s + "\n" }
|
||||||
string << "\n"
|
string << "\n"
|
||||||
gilded_rose.update_quality
|
gilded_rose.update_quality
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@ -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, -20, 0
|
||||||
Backstage passes to a TAFKAL80ETC concert, -25, 0
|
Backstage passes to a TAFKAL80ETC concert, -25, 0
|
||||||
Conjured Mana Cake, -27, 0
|
Conjured Mana Cake, -27, 0
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user