forked from emilybache/GildedRose-Refactoring-Kata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtexttest_fixture.R
33 lines (28 loc) · 874 Bytes
/
texttest_fixture.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
rm(list=ls())
source('gilded_rose.R')
writeLines('OMGHAI!')
items <- list(
item('+5 Dexterity Vest', 10, 20),
item('Aged Brie', 2, 0),
item('Elixir of the Mongoose', 5, 7),
item('Sulfuras, Hand of Ragnaros', 0, 80),
item('Sulfuras, Hand of Ragnaros', -1, 80),
item('Backstage passes to a TAFKAL80ETC concert', 15, 20),
item('Backstage passes to a TAFKAL80ETC concert', 10, 49),
item('Backstage passes to a TAFKAL80ETC concert', 5, 49),
# This Conjured item does not work properly yet
item('Conjured Mana Cake', 3, 6)
)
days <- 2
for (day in 0:days) {
writeLines(paste('-------- day ', day, ' --------', sep=''))
writeLines('name, sellIn, quality')
lapply(items,
function(item) {
writeLines(as.character(item))
}
)
writeLines('')
items <- update_quality(items)
}
rm('day', 'days', 'items')