mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +00:00
Port TextTestFixture.
This commit is contained in:
parent
a91a6ef695
commit
3b7cb71b77
@ -3,13 +3,13 @@
|
||||
## Run the unit tests from the Command-Line
|
||||
|
||||
```shell
|
||||
io tests/correctness/run.io
|
||||
io ./tests/correctness/run.io
|
||||
```
|
||||
|
||||
## Run the TextTest Fixture from Command-Line
|
||||
|
||||
```shell
|
||||
io tests/correctness/TexttestFixture.io
|
||||
io ./tests/correctness/TexttestFixture.io
|
||||
```
|
||||
|
||||
### Specify Number of Days
|
||||
@ -17,5 +17,5 @@ io tests/correctness/TexttestFixture.io
|
||||
For e.g. 10 days:
|
||||
|
||||
```shell
|
||||
io tests/correctness/TexttestFixture.io 10
|
||||
io ./tests/correctness/TexttestFixture.io 10
|
||||
```
|
||||
|
||||
34
io/tests/correctness/TexttestFixture.io
Normal file
34
io/tests/correctness/TexttestFixture.io
Normal file
@ -0,0 +1,34 @@
|
||||
doRelativeFile("../../io/Item.io")
|
||||
doRelativeFile("../../io/GildedRose.io")
|
||||
|
||||
writeln("OMGHAI!")
|
||||
|
||||
items := list(
|
||||
Item with("+5 Dexterity Vest", 10, 20), //
|
||||
Item with("Aged Brie", 2, 0), //
|
||||
Item with("Elixir of the Mongoose", 5, 7), //
|
||||
Item with("Sulfuras, Hand of Ragnaros", 0, 80), //
|
||||
Item with("Sulfuras, Hand of Ragnaros", -1, 80),
|
||||
Item with("Backstage passes to a TAFKAL80ETC concert", 15, 20),
|
||||
Item with("Backstage passes to a TAFKAL80ETC concert", 10, 49),
|
||||
Item with("Backstage passes to a TAFKAL80ETC concert", 5, 49),
|
||||
// this conjured item does not work properly yet
|
||||
Item with("Conjured Mana Cake", 3, 6)
|
||||
)
|
||||
|
||||
app := GildedRose with(items)
|
||||
|
||||
days := 2
|
||||
if (System args size > 1,
|
||||
days = System args at(1) asNumber + 1
|
||||
)
|
||||
|
||||
for(i, 0, days - 1,
|
||||
writeln("-------- day " .. i .. " --------")
|
||||
writeln("name, sellIn, quality")
|
||||
items foreach(item,
|
||||
writeln(item)
|
||||
)
|
||||
writeln
|
||||
app updateQuality
|
||||
)
|
||||
Loading…
Reference in New Issue
Block a user