Published on

Using Shazamcrest's assertThat


Today a colleague and I paired to fix an issue identified in our code. We did this TDD style - red/green tests. We paired by my colleague writing tests for the code which initially failed. I then implemented the code to make the tests pass.

As part of this exercise I saw my colleague use Shazamcrest's assertThat to test code instead of the one provided by JUnit. On asking him why he did this he mentioned how if the tests fail the output is far more readable and sure enough it is indeed more readable.