val expectedLength : Long)
extends HavePropertyMatcher[AnyRef, Long]
- This class is part of the ScalaTest matchers DSL. Please see the documentation for
MustMatchers for an overview of
the matchers DSL.
- Bill Venners
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
apply(objectWithProperty : AnyRef) : HavePropertyMatchResult[Long]
- This method enables the following syntax:
"hi" should not have (length (3))
ResultOfLengthWordApplication is a
HavePropertyMatcher[AnyRef, Long] is
so that you don't have to remember whether
length needs to be surrounded by parentheses when following
size can be used without parentheses: everything else
needs the parentheses. So this approach means that if you use the unneeded parentheses with
size, it will still work. This
apply method uses reflection to find and access the
property on the passed
objectWithProperty. Therefore if the object does not have the appropriate structure, the expression
will compile, but at will produce a
TestFailedException at runtime.
Copyright (C) 2001-2010 Artima, Inc. All rights reserved.