Reputation: 7012
I really like this syntax from Specs2 in order to test for equality:
1 + 1 === 2
instead of:
assert(1+1 == 2)
or the English-like synonims.
Can this syntax also be used in ScalaTest?
Here is the list of matchers that ScalaTest and Specs2 supports.
Upvotes: 0
Views: 72
Reputation: 7373
ScalaTest already supports this operator in trait TripleEqualsSupport
Here is the scaladoc reference for the current version
Upvotes: 0
Reputation: 11479
It is described as supported in the docs of ScalaTest, so yes:
http://www.scalatest.org/user_guide/using_matchers#checkingEqualityWithMatchers
result should === (3) // can customize equality and enforce type constraints
Upvotes: 1