This method enables the following syntax:
This method enables the following syntax:
book should have (title ("A Tale of Two Cities"))
^
This method enables the following syntax:
This method enables the following syntax:
book should have length (9)
^
Currently (as of ScalaTest 0.9.5), this method will produce a Matcher[AnyRef], and if the
AnyRef passed to that matcher's apply method does not have the appropriate length property
structure, all will compile but a TestFailedException will result at runtime explaining the problem. The one exception is that it will work on
java.util.List, even though that type has no length structure (its size property
will be used instead.) In a future ScalaTest release, this may be tightened so that all is statically checked at compile time.
This method enables the following syntax:
This method enables the following syntax:
book should have size (9)
^
Currently, this method will produce a Matcher[AnyRef], and if the
AnyRef passed to that matcher's apply method does not have the appropriate size property
structure, all will compile but a TestFailedException will result at runtime explaining the problem.
In a future ScalaTest release, this may be tightened so that all is statically checked at compile time.
This class is part of the ScalaTest matchers DSL. Please see the documentation for
ShouldMatchersorMustMatchersfor an overview of the matchers DSL.