org.specs2.matcher

ThrownExpectations

trait ThrownExpectations extends Expectations

Thrown expectations will throw a FailureException if a match fails

This trait can be extended to be used in another framework like ScalaTest:

trait ScalaTestExpectations extends ThrownExpectations { override protected def checkFailure[T](m: =>MatchResult[T]) = { m match { case f @ MatchFailure(ok, ko, _, _) => throw new TestFailedException(f.message, f.exception, 0) case _ => () } m } }

Linear Supertypes
Expectations, CanBeEqual, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ThrownExpectations
  2. Expectations
  3. CanBeEqual
  4. AnyRef
  5. Any
Visibility
  1. Public
  2. All

Type Members

  1. class CanBeEqualExpectation [T] extends AnyRef

  2. class Descriptible [T] extends AnyRef

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. implicit def canBeEqual [T] (t: ⇒ T): CanBeEqualExpectation[T]

    A value can be tested against another with the === operator.

    A value can be tested against another with the === operator. It is equivalent to writing a must_== b

    Attributes
    implicit
    Definition Classes
    CanBeEqual
  8. def checkFailure [T] (m: MatchResult[T]): MatchResult[T]

    this method can be overriden to throw exceptions when checking the match result

    this method can be overriden to throw exceptions when checking the match result

    Attributes
    protected
    Definition Classes
    Expectations
  9. def checkResultFailure (r: Result): Result

    this method can be overriden to throw exceptions when checking the result

    this method can be overriden to throw exceptions when checking the result

    Attributes
    protected
    Definition Classes
    ThrownExpectations → Expectations
  10. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def createExpectable [T] (t: ⇒ T, alias: Option[(String) ⇒ String]): Expectable[T]

    returns

    an Expectable with a description function

    Definition Classes
    ThrownExpectations → Expectations
  12. def createExpectable [T] (t: ⇒ T, alias: (String) ⇒ String): Expectable[T]

    returns

    an Expectable with a description function

    Definition Classes
    Expectations
  13. def createExpectable [T] (t: ⇒ T, alias: String): Expectable[T]

    returns

    an Expectable with a description

    Definition Classes
    Expectations
  14. def createExpectable [T] (t: ⇒ T): Expectable[T]

    returns

    an Expectable

    Definition Classes
    Expectations
  15. def createExpectableWithShowAs [T] (t: ⇒ T, show: ⇒ String): Expectable[T]

    returns

    an Expectable with a function to show the element T

    Definition Classes
    ThrownExpectations → Expectations
  16. implicit def describe [T] (t: ⇒ T): Descriptible[T]

    describe a value with the aka method

    describe a value with the aka method

    Attributes
    implicit
    Definition Classes
    Expectations
  17. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  18. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  19. def failure (f: Failure): Nothing

    Attributes
    protected
  20. def failure (m: String): Nothing

    Attributes
    protected
  21. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  22. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  23. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  24. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  25. def matchResultToResult [T] (m: MatchResult[T]): Result

    this method can be overriden to intercept the transformation of a MatchResult to a Result

    this method can be overriden to intercept the transformation of a MatchResult to a Result

    Attributes
    protected
    Definition Classes
    Expectations
  26. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  27. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  28. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  29. def pending (s: Pending): Nothing

    Attributes
    protected
  30. def pending (m: String): Nothing

    Attributes
    protected
  31. def skipped (s: Skipped): Nothing

    Attributes
    protected
  32. def skipped (m: String): Nothing

    Attributes
    protected
  33. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  34. def toString (): String

    Definition Classes
    AnyRef → Any
  35. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  36. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Expectations

Inherited from CanBeEqual

Inherited from AnyRef

Inherited from Any