org.specs2.matcher

ThrownExpectations

trait ThrownExpectations extends Expectations with StandardResults with StandardMatchResults with ScopedExpectations

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
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ThrownExpectations
  2. ScopedExpectations
  3. StandardMatchResults
  4. StandardResults
  5. Expectations
  6. CanBeEqual
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class CanBeEqualExpectation[T] extends AnyRef

    Definition Classes
    CanBeEqual
  2. class Descriptible[T] extends AnyRef

    Definition Classes
    Expectations

Value Members

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

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

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

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

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

    Definition Classes
    Any
  6. def anError: Error

    Definition Classes
    ThrownExpectations → StandardResults
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. 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

    Definition Classes
    CanBeEqual
  9. 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
  10. def checkMatchResultFailure[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
    ThrownExpectationsExpectations
  11. 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
    ThrownExpectationsExpectations
  12. def clone(): AnyRef

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

    returns

    an Expectable with a description function

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

    returns

    an Expectable with a description function

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

    returns

    an Expectable with a description

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

    returns

    an Expectable

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

    returns

    an Expectable with a function to show the element T

    Definition Classes
    ThrownExpectationsExpectations
  18. implicit def describe[T](t: ⇒ T): Descriptible[T]

    describe a value with the aka method

    describe a value with the aka method

    Definition Classes
    Expectations
  19. def done: Success

    Definition Classes
    StandardResults
  20. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

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

    Attributes
    protected
  23. def failure(m: String): Failure

    Attributes
    protected
  24. def failure: Failure

    Definition Classes
    ThrownExpectations → StandardResults
  25. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  28. implicit def inScope(s: Scope): Success

    transform a scope to a success to be able to create traits containing any variables and usable in any Examples

    transform a scope to a success to be able to create traits containing any variables and usable in any Examples

    Definition Classes
    ScopedExpectations
  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. def ko(m: String): MatchFailure[None.type]

    Definition Classes
    StandardMatchResults
  31. lazy val ko: MatchFailure[None.type]

  32. def mapMatchResult[T](m: MatchResult[T]): MatchResult[T]

    this method can be overriden to intercept a MatchResult and change its message before it is thrown

    this method can be overriden to intercept a MatchResult and change its message before it is thrown

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

    Definition Classes
    AnyRef
  34. final def notify(): Unit

    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  36. def ok(m: String): MatchSuccess[None.type]

    Definition Classes
    StandardMatchResults
  37. lazy val ok: MatchSuccess[None.type]

    Definition Classes
    StandardMatchResults
  38. def pending(s: Pending): Pending

    Attributes
    protected
  39. def pending(m: String): Pending

    Attributes
    protected
  40. def pending: Pending

    Definition Classes
    ThrownExpectations → StandardResults
  41. implicit def scopeAsResult[S <: Scope]: AsResult[S]

    typeclass to transform a Scope to a Result

    typeclass to transform a Scope to a Result

    Definition Classes
    ScopedExpectations
  42. def skipped(s: Skipped): Skipped

    Attributes
    protected
  43. def skipped(m: String): Skipped

    Attributes
    protected
  44. def skipped: Skipped

    Definition Classes
    ThrownExpectations → StandardResults
  45. def success(m: String): Success

    Attributes
    protected
  46. lazy val success: Success

    Definition Classes
    ThrownExpectations → StandardResults
  47. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  48. def toString(): String

    Definition Classes
    AnyRef → Any
  49. def todo: Pending

    Definition Classes
    ThrownExpectations → StandardResults
  50. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. def wontdo: Success

    Definition Classes
    StandardResults

Inherited from ScopedExpectations

Inherited from StandardMatchResults

Inherited from StandardResults

Inherited from Expectations

Inherited from CanBeEqual

Inherited from AnyRef

Inherited from Any

Ungrouped