GildedRose-Refactoring-Kata/janet
2023-07-13 11:01:41 +01:00
..
src updated tests and added README, based on review feedback. 2023-07-13 11:01:41 +01:00
test updated tests and added README, based on review feedback. 2023-07-13 11:01:41 +01:00
.gitignore updated tests and added README, based on review feedback. 2023-07-13 11:01:41 +01:00
project.janet updated tests and added README, based on review feedback. 2023-07-13 11:01:41 +01:00
README.md updated tests and added README, based on review feedback. 2023-07-13 11:01:41 +01:00

Gilded Rose

This is the Gilded Rose kata in janet.

Getting started

We'll need to install janet and jpm.

Running texttest

To produce output suitable for texttest, we can run:

janet test/texttest.janet

We can specify the number of days as an argument:

janet test/texttest.janet 30

Running tests

First, we install the test library dependency using jpm -l deps. Then we can run all the tests using:

jpm -l test

The testing library being used is judge, that enables the writing of inline snapshot tests. Specifically, Judge has the ability to capture a snapshot of stdout, which gives us a similar experience to that offered by texttest, but natively in the janet tests.

Having run jpm -l deps, we now have a (repository-local) installed executable of judge, which we can run directly using:

./jpm_tree/bin/judge

(pass -h for usage).