org.scalatest.matchers

trait Matchers

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

trait Matchers
extends Assertions
This trait 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
Direct Known Subclasses:
ShouldMatchers, MustMatchers

Value Summary
val a : AWord
This field enables the following syntax:
   badBook should not be a ('goodRead)
                         ^
   
val an : AnWord
This field enables the following syntax:
   badBook should not be an (excellentRead)
                         ^
   
val be : BeWord
This method enables syntax such as the following:
   obj should (be theSameInstanceAs (string) and be theSameInstanceAs (string))
               ^
   
val contain : ContainWord
This method enables syntax such as the following:
   list should (contain ('a') and have length (7))
                ^
   
val endWith : EndWithWord
This method enables syntax such as the following:
   string should (endWith ("ago") and include ("score"))
                  ^
   
val fullyMatch : FullyMatchWord
This method enables syntax such as the following:
   string should (fullyMatch regex ("Hel*o, wor.d") and not have length (99))
                  ^
   
val have : HaveWord
This method enables syntax such as the following:
   list should (have length (3) and not contain ('a'))
                ^
   
val include : IncludeWord
This method enables syntax such as the following:
   string should (include ("hope") and not startWith ("no"))
                  ^
   
val key : KeyWord
This field enables the following syntax:
   map should not contain key (10)
                          ^
   
val length : LengthWord
This field enables the following syntax:
   "hi" should not have length (3)
                        ^
   
val not : NotWord
This field enables syntax like the following:
   myFile should (not be an (directory) and not have ('name ("foo.bar")))
                  ^
   
val regex : RegexWord
This field enables the following syntax:
   "eight" should not fullyMatch regex ("""(-)?(\d+)(\.\d*)?""".r)
                                 ^
   
val size : SizeWord
This field enables the following syntax:
   set should not have size (3)
                       ^
   
val startWith : StartWithWord
This method enables syntax such as the following:
   string should (startWith ("Four") and include ("year"))
                  ^
   
val theSameInstanceAs : TheSameInstanceAsPhrase
This field enables the following syntax:
   oneString should not be theSameInstanceAs (anotherString)
                           ^
   
val value : ValueWord
This field enables the following syntax:
   map should not contain value (10)
                          ^
   
Method Summary
def < [T](right : T)(implicit view$13 : (T) => scala.Ordered[T]) : ResultOfLessThanComparison[T]
This method enables the following syntax:
   num should (not be < (10) and not be > (17))
                      ^
   
def <= [T](right : T)(implicit view$15 : (T) => scala.Ordered[T]) : ResultOfLessThanOrEqualToComparison[T]
This method enables the following syntax:
   num should (not be <= (10) and not be > (17))
                      ^
   
def === (right : Any) : ResultOfTripleEqualsApplication
This method enables the following syntax:
   num should not be === (10)
                     ^
   
def > [T](right : T)(implicit view$14 : (T) => scala.Ordered[T]) : ResultOfGreaterThanComparison[T]
This method enables the following syntax:
   num should (not be > (10) and not be < (7))
                      ^
   
def >= [T](right : T)(implicit view$16 : (T) => scala.Ordered[T]) : ResultOfGreaterThanOrEqualToComparison[T]
This method enables the following syntax:
   num should (not be >= (10) and not be < (7))
                      ^
   
implicit def convertByteToPlusOrMinusWrapper (right : Byte) : BytePlusOrMinusWrapper
Implicitly converts an object of type Byte to a BytePlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.
implicit def convertDoubleToPlusOrMinusWrapper (right : Double) : DoublePlusOrMinusWrapper
Implicitly converts an object of type Double to a DoublePlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.
implicit def convertFloatToPlusOrMinusWrapper (right : Float) : FloatPlusOrMinusWrapper
Implicitly converts an object of type Float to a FloatPlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.
implicit def convertGetLengthFieldToIntLengthWrapper (o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a getLength field of type Int to a LengthWrapper, to enable that object to be used with the have length (7) syntax.
implicit def convertGetLengthFieldToLongLengthWrapper (o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a getLength field of type Long to a LengthWrapper, to enable that object to be used with the have length (7) syntax.
implicit def convertGetLengthMethodToIntLengthWrapper (o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a getLength method of type Int to a LengthWrapper, to enable that object to be used with the have length (7) syntax.
implicit def convertGetLengthMethodToLongLengthWrapper (o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a getLength method of type Long to a LengthWrapper, to enable that object to be used with the have length (7) syntax.
implicit def convertGetSizeFieldToIntSizeWrapper (o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a getSize field of type Int to a LengthWrapper, to enable that object to be used with the have size (7) syntax.
implicit def convertGetSizeFieldToLongSizeWrapper (o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a getSize field of type Long to a LengthWrapper, to enable that object to be used with the have size (7) syntax.
implicit def convertGetSizeMethodToIntSizeWrapper (o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a getSize method of type Int to a LengthWrapper, to enable that object to be used with the have size (7) syntax.
implicit def convertGetSizeMethodToLongSizeWrapper (o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a getSize method of type Long to a LengthWrapper, to enable that object to be used with the have size (7) syntax.
implicit def convertIntToPlusOrMinusWrapper (right : Int) : IntPlusOrMinusWrapper
Implicitly converts an object of type Int to a IntPlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.
implicit def convertIterableMatcherToJavaCollectionMatcher [T](iterableMatcher : Matcher[scala.Iterable[T]]) : Matcher[java.util.Collection[T]]
This implicit conversion method enables the following syntax (javaColl is a java.util.Collection):
   javaColl should contain ("two")
   
The (contain element ("two")) expression will result in a Matcher[scala.Iterable[String]]. This implicit conversion method will convert that matcher to a Matcher[java.util.Collection[String]].
implicit def convertLengthFieldToIntLengthWrapper (o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a length field of type Int to a LengthWrapper, to enable that object to be used with the have length (7) syntax.
implicit def convertLengthFieldToLongLengthWrapper (o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a length field of type Long to a LengthWrapper, to enable that object to be used with the have length (7) syntax.
implicit def convertLengthMethodToIntLengthWrapper (o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a length method of type Int to a LengthWrapper, to enable that object to be used with the have length (7) syntax.
implicit def convertLengthMethodToLongLengthWrapper (o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a length method of type Long to a LengthWrapper, to enable that object to be used with the have length (7) syntax.
implicit def convertLongToPlusOrMinusWrapper (right : Long) : LongPlusOrMinusWrapper
Implicitly converts an object of type Long to a LongPlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.
implicit def convertMapMatcherToJavaMapMatcher [K, V](mapMatcher : Matcher[scala.collection.Map[K, V]]) : Matcher[java.util.Map[K, V]]
This implicit conversion method enables the following syntax (javaMap is a java.util.Map):
   javaMap should (contain key ("two"))
   
The (contain key ("two")) expression will result in a Matcher[scala.collection.Map[String, Any]]. This implicit conversion method will convert that matcher to a Matcher[java.util.Map[String, Any]].
implicit def convertShortToPlusOrMinusWrapper (right : Short) : ShortPlusOrMinusWrapper
Implicitly converts an object of type Short to a ShortPlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.
implicit def convertSizeFieldToIntSizeWrapper (o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a size field of type Int to a LengthWrapper, to enable that object to be used with the have size (7) syntax.
implicit def convertSizeFieldToLongSizeWrapper (o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a size field of type Long to a LengthWrapper, to enable that object to be used with the have size (7) syntax.
implicit def convertSizeMethodToIntSizeWrapper (o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a size method of type Int to a LengthWrapper, to enable that object to be used with the have size (7) syntax.
implicit def convertSizeMethodToLongSizeWrapper (o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a size method of type Long to a LengthWrapper, to enable that object to be used with the have size (7) syntax.
implicit def convertSymbolToHavePropertyMatcherGenerator (symbol : scala.Symbol) : HavePropertyMatcherGenerator
This implicit conversion method converts a Symbol to a HavePropertyMatcherGenerator, to enable the symbol to be used with the have ('author ("Dickens")) syntax.
implicit def convertToMatcherWrapper [T](leftMatcher : Matcher[T]) : MatcherWrapper[T]
This implicit conversion method enables ScalaTest matchers expressions that involve and and or.
def equal (right : Any) : Matcher[Any]
This method enables the following syntax:
   result should equal (7)
                 ^
   
def evaluating (fun : => Any) : ResultOfEvaluatingApplication
This method enables syntax such as the following:
   evaluating { "hi".charAt(-1) } should produce [StringIndexOutOfBoundsException]
   ^
   
def produce [T](implicit manifest : scala.reflect.Manifest[T]) : ResultOfProduceInvocation[T]
This method enables the following syntax:
   evaluating { "hi".charAt(-1) } should produce [StringIndexOutOfBoundsException]
   ^
   
Methods inherited from Assertions
assert, assert, assert, assert, convertToEqualizer, intercept, expect, expect, fail, fail, fail, fail
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
final class AWord 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.
final class AnWord 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.
final class BeWord 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.
final class BytePlusOrMinusWrapper (right : Byte) 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.
case final class ByteTolerance (val right : Byte, val tolerance : Byte) extends scala.Product
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ContainWord 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.
final class DoublePlusOrMinusWrapper (right : Double) 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.
case final class DoubleTolerance (val right : Double, val tolerance : Double) extends scala.Product
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class EndWithWord 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.
final class FloatPlusOrMinusWrapper (right : Float) 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.
case final class FloatTolerance (val right : Float, val tolerance : Float) extends scala.Product
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class FullyMatchWord 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.
final class HavePropertyMatcherGenerator (symbol : scala.Symbol) 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.
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.
final class IncludeWord 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.
final class IntPlusOrMinusWrapper (right : Int) 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.
case final class IntTolerance (val right : Int, val tolerance : Int) extends scala.Product
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class KeyWord 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.
final class LengthWord 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.
abstract class LengthWrapper 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.
final class LongPlusOrMinusWrapper (right : Long) 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.
case final class LongTolerance (val right : Long, val tolerance : Long) extends scala.Product
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class MatcherWrapper [T](leftMatcher : Matcher[T]) 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.
final class NotWord 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.
final class RegexWord 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.
final class ResultOfAWordToBePropertyMatcherApplication [T](val bePropertyMatcher : BePropertyMatcher[T]) 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.
final class ResultOfAWordToSymbolApplication (val symbol : scala.Symbol) 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.
final class ResultOfAnWordToBePropertyMatcherApplication [T](val bePropertyMatcher : BePropertyMatcher[T]) 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.
final class ResultOfAnWordToSymbolApplication (val symbol : scala.Symbol) 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.
final class ResultOfBeWordForAnyRef [T <: AnyRef](left : T, shouldBeTrue : Boolean) 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.
final class ResultOfContainWordForJavaMap [K, V](left : java.util.Map[K, V], shouldBeTrue : Boolean) 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.
final class ResultOfContainWordForMap [K, V](left : scala.collection.Map[K, V], shouldBeTrue : Boolean) 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.
final class ResultOfElementWordApplication [T](val expectedElement : T) 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.
final class ResultOfEndWithWordForString (left : java.lang.String, shouldBeTrue : Boolean) 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.
final class ResultOfEvaluatingApplication (val fun : () => Any) 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.
final class ResultOfFullyMatchWordForString (left : java.lang.String, shouldBeTrue : Boolean) 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.
final class ResultOfGreaterThanComparison [T](val right : T, implicit view$10 : (T) => scala.Ordered[T]) 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.
final class ResultOfGreaterThanOrEqualToComparison [T](val right : T, implicit view$12 : (T) => scala.Ordered[T]) 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.
sealed class ResultOfHaveWordForCollection [T](left : scala.Collection[T], shouldBeTrue : Boolean) 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.
sealed class ResultOfHaveWordForJavaCollection [T](left : java.util.Collection[T], shouldBeTrue : Boolean) 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.
final class ResultOfHaveWordForJavaList [T](left : java.util.List[T], shouldBeTrue : Boolean) extends ResultOfHaveWordForJavaCollection[T]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfHaveWordForJavaMap (left : java.util.Map[Any, Any], shouldBeTrue : Boolean) 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.
final class ResultOfHaveWordForLengthWrapper [A](left : A, shouldBeTrue : Boolean, implicit view$7 : (A) => LengthWrapper) 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.
final class ResultOfHaveWordForSeq [T](left : scala.Seq[T], shouldBeTrue : Boolean) extends ResultOfHaveWordForCollection[T]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfHaveWordForSizeWrapper [A](left : A, shouldBeTrue : Boolean, implicit view$8 : (A) => SizeWrapper) 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.
final class ResultOfHaveWordForString (left : java.lang.String, shouldBeTrue : Boolean) 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.
final class ResultOfIncludeWordForString (left : java.lang.String, shouldBeTrue : Boolean) 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.
final class ResultOfKeyWordApplication [T](val expectedKey : T) 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.
final class ResultOfLengthWordApplication (val expectedLength : Long) extends HavePropertyMatcher[AnyRef, Long] with 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.
final class ResultOfLessThanComparison [T](val right : T, implicit view$9 : (T) => scala.Ordered[T]) 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.
final class ResultOfLessThanOrEqualToComparison [T](val right : T, implicit view$11 : (T) => scala.Ordered[T]) 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.
sealed class ResultOfNotWord [T](left : T, shouldBeTrue : Boolean) 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.
sealed class ResultOfNotWordForAnyRef [T <: AnyRef](left : T, shouldBeTrue : Boolean) extends ResultOfNotWord[T]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForArray [E](left : scala.Array[E], shouldBeTrue : Boolean) extends ResultOfNotWordForAnyRef[scala.Array[E]]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForByte (left : Byte, shouldBeTrue : Boolean) extends ResultOfNotWord[Byte]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
sealed class ResultOfNotWordForCollection [E, T <: scala.Collection[E]](left : T, shouldBeTrue : Boolean) extends ResultOfNotWordForIterable[E, T]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForDouble (left : Double, shouldBeTrue : Boolean) extends ResultOfNotWord[Double]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForFloat (left : Float, shouldBeTrue : Boolean) extends ResultOfNotWord[Float]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForInt (left : Int, shouldBeTrue : Boolean) extends ResultOfNotWord[Int]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
sealed class ResultOfNotWordForIterable [E, T <: scala.Iterable[E]](left : T, shouldBeTrue : Boolean) extends ResultOfNotWordForAnyRef[T]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
sealed class ResultOfNotWordForJavaCollection [E, T <: java.util.Collection[E]](left : T, shouldBeTrue : Boolean) extends ResultOfNotWordForAnyRef[T]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForJavaList [E, T <: java.util.List[E]](left : T, shouldBeTrue : Boolean) extends ResultOfNotWordForJavaCollection[E, T]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForJavaMap [K, V](left : java.util.Map[K, V], shouldBeTrue : Boolean) extends ResultOfNotWordForAnyRef[java.util.Map[K, V]]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForLengthWrapper [A <: AnyRef](left : A, shouldBeTrue : Boolean, implicit view$6 : (A) => LengthWrapper) extends ResultOfNotWordForAnyRef[A]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForLong (left : Long, shouldBeTrue : Boolean) extends ResultOfNotWord[Long]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForMap [K, V](left : scala.collection.Map[K, V], shouldBeTrue : Boolean) extends ResultOfNotWordForCollection[(K, V), scala.collection.Map[K, V]]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForSeq [E, T <: scala.Seq[E]](left : T, shouldBeTrue : Boolean) extends ResultOfNotWordForCollection[E, T]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForShort (left : Short, shouldBeTrue : Boolean) extends ResultOfNotWord[Short]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForSizeWrapper [A <: AnyRef](left : A, shouldBeTrue : Boolean, implicit view$5 : (A) => SizeWrapper) extends ResultOfNotWordForAnyRef[A]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfNotWordForString (left : java.lang.String, shouldBeTrue : Boolean) extends ResultOfNotWordForAnyRef[java.lang.String]
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class ResultOfProduceInvocation [T](val clazz : java.lang.Class[T]) 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.
final class ResultOfRegexWordApplication (val regex : scala.util.matching.Regex) 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.
final class ResultOfSizeWordApplication (val expectedSize : Long) extends HavePropertyMatcher[AnyRef, Long] with 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.
final class ResultOfStartWithWordForString (left : java.lang.String, shouldBeTrue : Boolean) 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.
final class ResultOfTheSameInstanceAsApplication (val right : AnyRef) 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.
final class ResultOfTripleEqualsApplication (val right : Any) 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.
final class ResultOfValueWordApplication [T](val expectedValue : T) 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.
final class ShortPlusOrMinusWrapper (right : Short) 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.
case final class ShortTolerance (val right : Short, val tolerance : Short) extends scala.Product
This class is part of the ScalaTest matchers DSL. Please see the documentation for ShouldMatchers or MustMatchers for an overview of the matchers DSL.
final class SizeWord 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.
abstract class SizeWrapper 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.
final class StartWithWord 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.
final class TheSameInstanceAsPhrase 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.
final class ValueWord 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.
Value Details
val not : NotWord
This field enables syntax like the following:
   myFile should (not be an (directory) and not have ('name ("foo.bar")))
                  ^
   

val be : BeWord
This method enables syntax such as the following:
   obj should (be theSameInstanceAs (string) and be theSameInstanceAs (string))
               ^
   

val have : HaveWord
This method enables syntax such as the following:
   list should (have length (3) and not contain ('a'))
                ^
   

val contain : ContainWord
This method enables syntax such as the following:
   list should (contain ('a') and have length (7))
                ^
   

val include : IncludeWord
This method enables syntax such as the following:
   string should (include ("hope") and not startWith ("no"))
                  ^
   

val fullyMatch : FullyMatchWord
This method enables syntax such as the following:
   string should (fullyMatch regex ("Hel*o, wor.d") and not have length (99))
                  ^
   

val startWith : StartWithWord
This method enables syntax such as the following:
   string should (startWith ("Four") and include ("year"))
                  ^
   

val endWith : EndWithWord
This method enables syntax such as the following:
   string should (endWith ("ago") and include ("score"))
                  ^
   

val length : LengthWord
This field enables the following syntax:
   "hi" should not have length (3)
                        ^
   

val size : SizeWord
This field enables the following syntax:
   set should not have size (3)
                       ^
   

val key : KeyWord
This field enables the following syntax:
   map should not contain key (10)
                          ^
   

val value : ValueWord
This field enables the following syntax:
   map should not contain value (10)
                          ^
   

val a : AWord
This field enables the following syntax:
   badBook should not be a ('goodRead)
                         ^
   

val an : AnWord
This field enables the following syntax:
   badBook should not be an (excellentRead)
                         ^
   

val theSameInstanceAs : TheSameInstanceAsPhrase
This field enables the following syntax:
   oneString should not be theSameInstanceAs (anotherString)
                           ^
   

val regex : RegexWord
This field enables the following syntax:
   "eight" should not fullyMatch regex ("""(-)?(\d+)(\.\d*)?""".r)
                                 ^
   

Method Details
implicit def convertToMatcherWrapper[T](leftMatcher : Matcher[T]) : MatcherWrapper[T]
This implicit conversion method enables ScalaTest matchers expressions that involve and and or.

implicit def convertIterableMatcherToJavaCollectionMatcher[T](iterableMatcher : Matcher[scala.Iterable[T]]) : Matcher[java.util.Collection[T]]
This implicit conversion method enables the following syntax (javaColl is a java.util.Collection):
   javaColl should contain ("two")
   
The (contain element ("two")) expression will result in a Matcher[scala.Iterable[String]]. This implicit conversion method will convert that matcher to a Matcher[java.util.Collection[String]].

implicit def convertMapMatcherToJavaMapMatcher[K, V](mapMatcher : Matcher[scala.collection.Map[K, V]]) : Matcher[java.util.Map[K, V]]
This implicit conversion method enables the following syntax (javaMap is a java.util.Map):
   javaMap should (contain key ("two"))
   
The (contain key ("two")) expression will result in a Matcher[scala.collection.Map[String, Any]]. This implicit conversion method will convert that matcher to a Matcher[java.util.Map[String, Any]].

implicit def convertLengthFieldToIntLengthWrapper(o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a length field of type Int to a LengthWrapper, to enable that object to be used with the have length (7) syntax.

implicit def convertLengthMethodToIntLengthWrapper(o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a length method of type Int to a LengthWrapper, to enable that object to be used with the have length (7) syntax.

implicit def convertGetLengthFieldToIntLengthWrapper(o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a getLength field of type Int to a LengthWrapper, to enable that object to be used with the have length (7) syntax.

implicit def convertGetLengthMethodToIntLengthWrapper(o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a getLength method of type Int to a LengthWrapper, to enable that object to be used with the have length (7) syntax.

implicit def convertLengthFieldToLongLengthWrapper(o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a length field of type Long to a LengthWrapper, to enable that object to be used with the have length (7) syntax.

implicit def convertLengthMethodToLongLengthWrapper(o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a length method of type Long to a LengthWrapper, to enable that object to be used with the have length (7) syntax.

implicit def convertGetLengthFieldToLongLengthWrapper(o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a getLength field of type Long to a LengthWrapper, to enable that object to be used with the have length (7) syntax.

implicit def convertGetLengthMethodToLongLengthWrapper(o : AnyRef) : LengthWrapper
This implicit conversion method converts an object with a getLength method of type Long to a LengthWrapper, to enable that object to be used with the have length (7) syntax.

implicit def convertSizeFieldToIntSizeWrapper(o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a size field of type Int to a LengthWrapper, to enable that object to be used with the have size (7) syntax.

implicit def convertSizeMethodToIntSizeWrapper(o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a size method of type Int to a LengthWrapper, to enable that object to be used with the have size (7) syntax.

implicit def convertGetSizeFieldToIntSizeWrapper(o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a getSize field of type Int to a LengthWrapper, to enable that object to be used with the have size (7) syntax.

implicit def convertGetSizeMethodToIntSizeWrapper(o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a getSize method of type Int to a LengthWrapper, to enable that object to be used with the have size (7) syntax.

implicit def convertSizeFieldToLongSizeWrapper(o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a size field of type Long to a LengthWrapper, to enable that object to be used with the have size (7) syntax.

implicit def convertSizeMethodToLongSizeWrapper(o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a size method of type Long to a LengthWrapper, to enable that object to be used with the have size (7) syntax.

implicit def convertGetSizeFieldToLongSizeWrapper(o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a getSize field of type Long to a LengthWrapper, to enable that object to be used with the have size (7) syntax.

implicit def convertGetSizeMethodToLongSizeWrapper(o : AnyRef) : SizeWrapper
This implicit conversion method converts an object with a getSize method of type Long to a LengthWrapper, to enable that object to be used with the have size (7) syntax.

implicit def convertSymbolToHavePropertyMatcherGenerator(symbol : scala.Symbol) : HavePropertyMatcherGenerator
This implicit conversion method converts a Symbol to a HavePropertyMatcherGenerator, to enable the symbol to be used with the have ('author ("Dickens")) syntax.

def equal(right : Any) : Matcher[Any]
This method enables the following syntax:
   result should equal (7)
                 ^
   

The left should equal (right) syntax works by calling == on the left value, passing in the right value, on every type except arrays. If left is an array, deepEquals will be invoked on left, passing in right. Thus, even though this expression will yield false, because Array's equals method compares object identity:

   Array(1, 2) == Array(1, 2) // yields false
   

The following expression will not result in a TestFailedException, because deepEquals compares the two arrays structurally, taking into consideration the equality of the array's contents:

   Array(1, 2) should equal (Array(1, 2)) // succeeds (i.e., does not throw TestFailedException)
   

If you ever do want to verify that two arrays are actually the same object (have the same identity), you can use the be theSameInstanceAs syntax.


implicit def convertDoubleToPlusOrMinusWrapper(right : Double) : DoublePlusOrMinusWrapper
Implicitly converts an object of type Double to a DoublePlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.

implicit def convertFloatToPlusOrMinusWrapper(right : Float) : FloatPlusOrMinusWrapper
Implicitly converts an object of type Float to a FloatPlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.

implicit def convertLongToPlusOrMinusWrapper(right : Long) : LongPlusOrMinusWrapper
Implicitly converts an object of type Long to a LongPlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.

implicit def convertIntToPlusOrMinusWrapper(right : Int) : IntPlusOrMinusWrapper
Implicitly converts an object of type Int to a IntPlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.

implicit def convertShortToPlusOrMinusWrapper(right : Short) : ShortPlusOrMinusWrapper
Implicitly converts an object of type Short to a ShortPlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.

implicit def convertByteToPlusOrMinusWrapper(right : Byte) : BytePlusOrMinusWrapper
Implicitly converts an object of type Byte to a BytePlusOrMinusWrapper, to enable a plusOrMinus method to be invokable on that object.

def <[T](right : T)(implicit view$13 : (T) => scala.Ordered[T]) : ResultOfLessThanComparison[T]
This method enables the following syntax:
   num should (not be < (10) and not be > (17))
                      ^
   

def >[T](right : T)(implicit view$14 : (T) => scala.Ordered[T]) : ResultOfGreaterThanComparison[T]
This method enables the following syntax:
   num should (not be > (10) and not be < (7))
                      ^
   

def <=[T](right : T)(implicit view$15 : (T) => scala.Ordered[T]) : ResultOfLessThanOrEqualToComparison[T]
This method enables the following syntax:
   num should (not be <= (10) and not be > (17))
                      ^
   

def >=[T](right : T)(implicit view$16 : (T) => scala.Ordered[T]) : ResultOfGreaterThanOrEqualToComparison[T]
This method enables the following syntax:
   num should (not be >= (10) and not be < (7))
                      ^
   

def ===(right : Any) : ResultOfTripleEqualsApplication
This method enables the following syntax:
   num should not be === (10)
                     ^
   

def evaluating(fun : => Any) : ResultOfEvaluatingApplication
This method enables syntax such as the following:
   evaluating { "hi".charAt(-1) } should produce [StringIndexOutOfBoundsException]
   ^
   

def produce[T](implicit manifest : scala.reflect.Manifest[T]) : ResultOfProduceInvocation[T]
This method enables the following syntax:
   evaluating { "hi".charAt(-1) } should produce [StringIndexOutOfBoundsException]
   ^
   


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