| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |
trait Expectable[T]
extends
ScalaObject
thisExpectable must passMatcherIt can be optionally related to an example when created for an anonymous example. Otherwise it just fires a FailureException when failing:
object spec extends Specification {
// is automatically related to an anonymous example
// it will be executed only once the example is executed
// @see org.specs.specification.ExpectableFactory
// @see org.specs.specification.ExampleExpectationsListener
1 must_== 1
// in that case, no example is set but during the execution of the "in" part
// the failure exception will be caught by the example and stored
"this example fails" in { 1 must_== 0 }
}
object test extends SpecsMatchers {
// this expectable is not related to any example and executes right away throwing an exception if failing
1 must_== 1
}
| description |
protected var description
stores a precise description of the thing being expected
[details]
This description is meant to be passed to the matcher for better failure reporting.
|
Option[String] |
| != |
final def !=(arg0 : Any)
|
Boolean | Any |
| != |
final def !=(arg0 : Object)
|
Boolean | AnyRef |
| == |
final def ==(arg0 : Object)
|
Boolean | AnyRef |
| == |
final def ==(arg0 : Any)
|
Boolean | Any |
| applyMatcher |
def applyMatcher[U >: T](m : => Matcher[U], value : => T)
Apply a matcher for this expectable value
[details]
Execute the matcher directly or add it to its related example for execution.
It either throws a FailureException or return a SuccessValue object.
The expectation listener gets notified of a new expectation with a fresh copy of this expectable.
The matcher gets
|
SuccessValue | |
| asInstanceOf |
final def asInstanceOf[T0]
|
T0 | Any |
| clone |
protected def clone
|
Object | AnyRef |
| 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 |
| ne |
final def ne(arg0 : Object)
|
Boolean | AnyRef |
| notify |
final def notify
|
Unit | AnyRef |
| notifyAll |
final def notifyAll
|
Unit | AnyRef |
| setExample |
def setExample[T](ex : Example)
Set a specific example to hold the results of this matcher
|
Unit | |
| setExpectationsListener |
def setExpectationsListener(listener : ExampleExpectationsListener)
setter for the expectation listener
|
Expectable[T] | |
| setSuccessValueToString |
def setSuccessValueToString(f : (SuccessValue) => String)
Set a new function to render success values
|
Unit | |
| synchronized |
final def synchronized[T0](arg0 : T0)
|
T0 | AnyRef |
| toString |
def toString
|
String | AnyRef |
| wait |
final def wait(arg0 : Long)
|
Unit | AnyRef |
| wait |
final def wait
|
Unit | AnyRef |
| wait |
final def wait(arg0 : Long, arg1 : Int)
|
Unit | AnyRef |
| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |