For example, for code like this:
myNum must beEqualTo("SOME INTERESTING TEXT")
The message will be like the following:
java.lang.Exception: ArrayBuffer() doesn't have size 1 but size 0
Is there an elegant way to get customised message displayed here?
First you can name value you're testing.
myNum aka "meaningful name" must_== expectedValue
You can also overwrite the full message.
(myNum must_== expectedValue).setMessage("Full failure message")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With