org.specs.matcher.AnyMatchers.SeqMatcher

class SeqMatcher

class SeqMatcher[S, T](s : Seq[S], f : (S) => Matcher[T])

 extends Matcher[Seq[T]]


The SeqMatcher class is a matcher matching a sequence of objects with a matcher returned by a function.

Usage:List(1, 2, 3) must ((beEqualTo(_:Int)).toSeq)(List(1, 2, 3))



Source: AnyMatchers.scala(460)

 Constructors

def this(s : Seq[S], f : (S) => Matcher[T])

 Fields

desc protected var desc
Optional description of the expectable object that will be passed to the matcher [details]
It will be set on the matcher when creating it through the following construction: a aka "this value" must beTrue.
The 'aka' ("also known as") method sets the description in the ExpectableFactory.
Option[String] AbstractMatcher
description def description
[details]
return
- the precise description of the example
Option[String] AbstractMatcher
not def not
The not operator allow to combine to matchers through a logical not [details]
m1.not returns a matcher failing if m1 succeeds, and succeeding if m1 fails
Matcher[T] Matcher
orSkip def orSkip
Alias for orSkipExample
Matcher[T] Matcher
orSkipExample def orSkipExample
The orSkipExample operator throws a SkippedException if the matcher fails
Matcher[T] Matcher

 Methods

!= final def !=(arg0 : Any) Boolean Any
!= final def !=(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Any) Boolean Any
^^ def ^^[A](f : (A) => T) Matcher[A] Matcher
and def and(m : => Matcher[T])
The and operator allow to combine to matchers through a logical and [details]
m1 and m2 can successfully match a value a only if m1 succeeds and m2 succeeds also
Matcher[T] Matcher
apply def apply(t : => Seq[T])
this function must be implemented by subclasses [details]
return
- a triple with a boolean indicating the success or failure of the matcher and 2 messages, the ok message, and the ko message
(Boolean, String, String)
asInstanceOf final def asInstanceOf[T0] T0 Any
clone protected def clone Object AnyRef
composeWithFunction def composeWithFunction[A](f : (A) => T)
The ^^ operator returns a matcher which will apply a function before doing the match
Matcher[A] Matcher
d protected def d(value : Any)
[details]
return
- the description of the matched value, quoted.
String AbstractMatcher
dUnquoted protected def dUnquoted(value : Any)
[details]
return
- the description of the matched value, unquoted.
String AbstractMatcher
eq final def eq(arg0 : Object) Boolean AnyRef
equals def equals(arg0 : Any) Boolean AnyRef
finalize protected def finalize Unit AnyRef
getClass final def getClass Class[Object] AnyRef
hashCode def hashCode Int AnyRef
isInstanceOf final def isInstanceOf[T0] Boolean Any
lazily def lazily
The lazily operator returns a matcher which will match a function returning the expected value
Matcher[() => T] Matcher
ne final def ne(arg0 : Object) Boolean AnyRef
notify final def notify Unit AnyRef
notifyAll final def notifyAll Unit AnyRef
or def or(m : => Matcher[T])
The or operator allow to combine to matchers through a logical or [details]
m1 or m2 can successfully match a value a if m1 succeeds or m2 succeeds. m2 is not evaluated if m1 succeeds
Matcher[T] Matcher
setDescription def setDescription(d : Option[String])
set the description of the matcher
AbstractMatcher[T] AbstractMatcher
synchronized final def synchronized[T0](arg0 : T0) T0 AnyRef
toMatcherResult implicit def toMatcherResult(t : (Boolean, String, String)) MatcherResult MatcherResult
toString def toString String AnyRef
toTuple implicit def toTuple(m : MatcherResult) (Boolean, String, String) MatcherResult
unless def unless(condition : => Boolean)
The unless operator returns a matcher which will be ok only if a condition is false
Matcher[T] Matcher
wait final def wait Unit AnyRef
wait final def wait(arg0 : Long) Unit AnyRef
wait final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
when def when(condition : => Boolean)
The when operator returns a matcher which will be ok only if a condition is true
Matcher[T] Matcher
xor def xor(m : => Matcher[T])
The xor operator allow to combine to matchers through a logical xor [details]
m1 xor m2 can successfully match a value a if m1 succeeds and m2 fails, or if m1 fails and m2 succeeds
Matcher[T] Matcher
Copyright (c) 2007-2009. All Rights Reserved.