Improve texttest documentation

Specifically make it easier to test the Java version.
Added a test rig so you can use gradle to run the java version
This commit is contained in:
emily committed 2023-11-03 10:32:29 +01:00
1 parent 615ad96ea4
commit 755ed77692
7 files changed
+58 -22

No files matched your search

+4
View File
@@ -13,3 +13,7 @@ For e.g. 10 days:
```
./gradlew -q text --args 10
```
## Run the TextTest approval test that comes with this project
There are instructions in the [TextTest Readme](https://github.com/emilybache/GildedRose-Refactoring-Kata/blob/main/texttests/README.md) for setting up TextTest. What's unusual for the Java version is there are two executables listed in [config.gr](https://github.com/emilybache/GildedRose-Refactoring-Kata/blob/main/texttests/config.gr) for Java. One uses Gradle wrapped in a python script, the other relies on your CLASSPATH being set correctly in [environment.gr](https://github.com/emilybache/GildedRose-Refactoring-Kata/blob/main/texttests/environment.gr).
@@ -59,4 +59,4 @@ class GildedRose {
}
}
}
}
}
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env python
"""
This script uses Gradle to execute the TexttestFixture.
It is designed to be used by TextTest and specified in the file 'texttests/config.gr' in this repo.
It is more convenient for TextTest to use since Gradle needs
several arguments in addition to the one the TextTest fixture needs.
"""
import os
import subprocess
import sys
args = " ".join(sys.argv[1:])
TEXTTEST_HOME = os.environ.get("TEXTTEST_HOME", os.getcwd())
subprocess.run(f"{TEXTTEST_HOME}/Java/gradlew -p {TEXTTEST_HOME}/Java -q text --args {args}", shell=True)