GildedRose-Refactoring-Kata/scala
2025-10-05 21:16:47 +02:00
..
approvaltests added template with the result of the first run of the approval tests 2025-09-29 22:16:04 +02:00
project * ignored old approval test 2025-10-04 21:19:41 +02:00
src before cleanup without java tests 2025-10-05 21:16:47 +02:00
.gitignore before cleanup without java tests 2025-10-05 21:16:47 +02:00
build.sbt before cleanup without java tests 2025-10-05 21:16:47 +02:00
README.md updated README.md for scala 2025-09-29 22:16:04 +02:00
texttest_rig.py removed extra, unnecessary run in texttest_rig.py 2025-09-29 22:16:04 +02:00

Gilded Rose starting position in Scala 3 scalatest

Build the project

sbt compile

Run the Gilded Rose Command-Line program

For e.g. 10 days:

sbt "run 10"

Run all the unit tests

sbt test

Run approval tests

The approval test creates a file with an result of the test fixture in approvaltests/gildedrose.testresult.txt. The very first test run will fail and the resulting gildedrose.testresult.txt can be moved/renamed to gildedrose.approved.txt.

The approval tests in the test directory under GildedRoseApprovalTest.scala will regenerate the test result on each run and compare it to the approved file. The approval test will fail when thee are any differences between the files.

To approve a new version simply rename the resulting test output to gildedrose.approved.txt

Approval tests are part of the test suite triggered by sbt.

sbt test

Run texttest version of approval tests

To run the texttest version, first edit the texttest configuration file. It contains to sections for scala that need to be uncommented.

  • the executable and interpreter lines to run texttest_rig.py to trigger an sbt run
  • the four lines in the run_dependent_text section to ignore sbt's info and success lines in the output.

Be aware that running the texttest version is somewhat slow since starting sbt takes some time.