This test is OK, because I use toString explicitly
"have one sentence by '...'" in {
val text1 = Text("some text...")
text1.sentences must have size(1)
text1.sentences(0).toString must_== "some text"
}
If without toSting the test it fails with message like:
Expected :some text
Actual :some text
java.lang.Exception: 'some text: dictionary.Sentence' is not equal to 'some text: java.lang.String'
I understand the sense of it (in general), but since
toStringis invoked anyway shouldn't it check string to string then?What is the best way to write this test to be concise? Without using
toStringdirectly.