Litmus is a Play!Framework (1.2.x) module that allows for more expressive testing. For example, it allows you to write most of your functional tests as one-liners like these:
assertThat(get("/foo/bar").isUtf8();
assertThat(get("/foo/bar").hasFlashParam("success");
Litmus also contains a small superclass for model validation tests (thoughtfully called "ValidationTest"), to take away any excuse you might have not to test validation anymore. You can write things like:
assertThat("firstName").isRequired();
assertThat("firstName").shouldNotBe("");
assertThat("houseNumber").withValue(123).isValid();
For more information on how to use Litmus, you can refer to
- the litmus-samples project (http://github.com/bverbeken/litmus-samples). This is a normal play application that has examples for all the available asserts.
- the documentation page, which can be found here.
- more asserts (json assert, ..?)
- other types of testing (webdriver,javascript unit testing, etc)
- possibly a custom test runner so that all of these tests can be catogorized, ran individually, etc.
Source code: https://github.com/bverbeken/litmus
Issue tracking: https://github.com/bverbeken/litmus/issues
This is a work in progress (of course it is, it's software).
If litmus is missing features you dream of, or you have suggestions on how it could be made better, tweet me (@bverbeken) or clone the github repo and start sending pull requests.