org.scalatest.matchers.Matchers

class HaveWord

[source: org/scalatest/matchers/Matchers.scala]

final class HaveWord
extends AnyRef
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
Author
Bill Venners
Method Summary
def apply [T](firstPropertyMatcher : HavePropertyMatcher[T, Any], propertyMatchers : HavePropertyMatcher[T, Any]*) : Matcher[T]
This method enables the following syntax:
     book should have (title ("A Tale of Two Cities"))
                      ^
     
def length (expectedLength : Long) : Matcher[AnyRef]
This method enables the following syntax:
     book should have length (9)
                      ^
     
def size (expectedSize : Long) : Matcher[AnyRef]
This method enables the following syntax:
     book should have size (9)
                      ^
     
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def length(expectedLength : Long) : Matcher[AnyRef]
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.


def size(expectedSize : Long) : Matcher[AnyRef]
This method enables the following syntax:
     book should have size (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 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.


def apply[T](firstPropertyMatcher : HavePropertyMatcher[T, Any], propertyMatchers : HavePropertyMatcher[T, Any]*) : Matcher[T]
This method enables the following syntax:
     book should have (title ("A Tale of Two Cities"))
                      ^
     


Copyright (C) 2001-2010 Artima, Inc. All rights reserved.