mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-18 20:05:04 +00:00
updated tests and added README, based on review feedback.
This commit is contained in:
1 parent
42d6bce336
commit
4f43ddb78f
6 files changed
+76
-31
No files matched your search
@@ -0,0 +1,39 @@
|
||||
# Gilded Rose
|
||||
|
||||
This is the Gilded Rose kata in [janet](https://janet-lang.org).
|
||||
|
||||
## Getting started
|
||||
|
||||
We'll need to install [janet and jpm](https://janet-lang.org/docs/index.html).
|
||||
|
||||
## Running texttest
|
||||
|
||||
To produce output suitable for texttest, we can run:
|
||||
|
||||
```sh
|
||||
janet test/texttest.janet
|
||||
```
|
||||
|
||||
We can specify the number of days as an argument:
|
||||
|
||||
```sh
|
||||
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:
|
||||
|
||||
```sh
|
||||
jpm -l test
|
||||
```
|
||||
|
||||
The testing library being used is [judge](https://github.com/ianthehenry/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:
|
||||
|
||||
```sh
|
||||
./jpm_tree/bin/judge
|
||||
```
|
||||
(pass `-h` for usage).
|
||||
Reference in new issue
Block a user