org.specs2.matcher

MatchersImplicits

trait MatchersImplicits extends Expectations with MatchResultCombinators with MatchResultImplicits

This trait provides implicit definitions from MatchResults and Booleans to Results.

It also allows to:

- create matchers from functions - create matchers for seqs and sets from single matchers

Self Type
MatchersImplicits
Linear Supertypes
MatchResultImplicits, MatchResultCombinators, ResultLogicalCombinators, Results, MatchResultLogicalCombinators, Expectations, CanBeEqual, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MatchersImplicits
  2. MatchResultImplicits
  3. MatchResultCombinators
  4. ResultLogicalCombinators
  5. Results
  6. MatchResultLogicalCombinators
  7. Expectations
  8. CanBeEqual
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class AdapterFunction[T, S](f: (T) ⇒ S) extends Product with Serializable

  2. class CanBeEqualExpectation[T] extends AnyRef

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

    Definition Classes
    Expectations
  4. class MatchResultCombinator[T] extends AnyRef

    Definition Classes
    MatchResultLogicalCombinators
  5. class MatchResultFunctionVerification[U, T] extends AnyRef

  6. class MatcherFunction[S, T] extends AnyRef

  7. class MatcherFunction2[T] extends AnyRef

  8. class ResultLogicalCombinator extends AnyRef

    Definition Classes
    ResultLogicalCombinators
  9. class SeqMatcher[S, T] extends Matcher[Seq[T]]

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

  10. class SetMatcher[S, T] extends Matcher[Set[T]]

    The SetMatcher class is a matcher matching a set of objects with a matcher returned by a function.

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. implicit def adapterFunction[T, S](f: (T) ⇒ S): AdapterFunction[T, S]

    this implicit provides an inverted syntax to adapt matchers to make the adaptation more readable in some cases: - def haveExtension(extension: =>String) = ((_:File).

    this implicit provides an inverted syntax to adapt matchers to make the adaptation more readable in some cases: - def haveExtension(extension: =>String) = ((_:File).getPath) ^^ endWith(extension)

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. implicit def asResult[T, M[_] <: MatchResult[_]](r: M[T]): Result

    implicit definition to transform any MatchResult to a Result

    implicit definition to transform any MatchResult to a Result

    Definition Classes
    MatchResultImplicits
  9. def atLeastOnce[T, U](values: GenTraversableOnce[T])(f: (T) ⇒ MatchResult[U]): MatchResult[Seq[T]]

    verify the function f for at least one value

  10. def atLeastOnceWhen[T, U](values: GenTraversable[T])(f: PartialFunction[T, MatchResult[U]]): MatchResult[Seq[T]]

    verify the function f for at least one value, where the PartialFunction is defined

  11. 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
  12. 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
  13. 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
    Expectations
  14. 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
    Expectations
  15. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. implicit def combineBoolean(b: ⇒ Boolean): ResultLogicalCombinator

    Definition Classes
    ResultLogicalCombinators
  17. implicit def combineMatchResult[T](m: ⇒ MatchResult[T]): MatchResultCombinator[T]

    Definition Classes
    MatchResultLogicalCombinators
  18. implicit def combineResult(r: ⇒ Result): ResultLogicalCombinator

    Definition Classes
    ResultLogicalCombinators
  19. def createExpectable[T](t: ⇒ T, alias: Option[(String) ⇒ String]): Expectable[T]

    returns

    an Expectable with a description function

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

    returns

    an Expectable with a description function

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

    returns

    an Expectable with a description

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

    returns

    an Expectable

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

    returns

    an Expectable with a function to show the element T

    Definition Classes
    Expectations
  24. 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
  25. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  27. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  28. def forall[T, U](values: GenTraversableOnce[T])(f: (T) ⇒ MatchResult[U]): MatchResult[Seq[T]]

    verify the function f for all the values, stopping after the first failure

  29. def forallWhen[T, U](values: GenTraversable[T])(f: PartialFunction[T, MatchResult[U]]): MatchResult[Seq[T]]

    verify the function f for all the values, stopping after the first failure, where the PartialFunction is defined

  30. def foreach[T, U](values: GenTraversableOnce[T])(f: (T) ⇒ MatchResult[U]): MatchResult[Seq[T]]

    verify the function f for all the values, and collect all failures

  31. def foreachWhen[T, U](values: GenTraversable[T])(f: PartialFunction[T, MatchResult[U]]): MatchResult[Seq[T]]

    verify the function f for all the values, and collect all failures, where the PartialFunction is defined

  32. implicit def fromMatchResult(r: ⇒ MatchResult[_]): Boolean

    implicit definition to accept any MatchResult as a Boolean value.

    implicit definition to accept any MatchResult as a Boolean value. It is true if the MatchResult is not an Error or a Failure

    Definition Classes
    MatchResultImplicits
  33. implicit def functionAndKoMessageToMatcher[T](f: ((T) ⇒ Boolean, (T) ⇒ String)): Matcher[T]

    This method transform a function to a Matcher

  34. implicit def functionAndMessagesToMatcher[T](f: ((T) ⇒ Boolean, (T) ⇒ String, (T) ⇒ String)): Matcher[T]

    This method transform a function, with function descriptors to a Matcher

  35. implicit def functionToMatcher[T](f: ((T) ⇒ Boolean, String)): Matcher[T]

    This method transform a function to a Matcher

  36. implicit def functionToMatcher2[T](f: ((T) ⇒ Boolean, String, String)): Matcher[T]

    This method transform a function to a Matcher

  37. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  40. 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
  41. implicit def matchResultAsResult[T, M[_] <: MatchResult[_]]: AsResult[M[T]]

    implicit typeclass instance to create examples from MatchResults

    implicit typeclass instance to create examples from MatchResults

    Definition Classes
    MatchResultImplicits
  42. implicit def matchResultFunctionToMatcher[T](f: (T) ⇒ MatchResult[_]): Matcher[T]

    This method transform a function returning a MatchResult to a Matcher

  43. implicit def matchResultSeqAsResult[T]: AsResult[Seq[MatchResult[T]]]

    implicit typeclass instance to create examples from a sequence of MatchResults

    implicit typeclass instance to create examples from a sequence of MatchResults

    Definition Classes
    MatchResultImplicits
  44. implicit def matcherFunction[S, T](f: (S) ⇒ Matcher[T]): MatcherFunction[S, T]

    Add functionalities to functions returning matchers so that they can be combined before taking a value and returning actual matchers

  45. implicit def matcherFunction2[T](f: (T) ⇒ Matcher[T]): MatcherFunction2[T]

  46. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  49. implicit def pairFunctionToMatcher[T](f: (T) ⇒ (Boolean, String)): Matcher[T]

    This method transform a function returning a pair (Boolean, String for ko message) to a Matcher

  50. implicit def seqToResult[T](r: Seq[MatchResult[T]]): Result

    implicit definition to transform a Seq of MatchResults to a Result

    implicit definition to transform a Seq of MatchResults to a Result

    Definition Classes
    MatchResultImplicits
  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  52. implicit def toResult(b: Boolean): Result

    implicit definition to accept any boolean value as a Result This avoids writing b must beTrue

    implicit definition to accept any boolean value as a Result This avoids writing b must beTrue

    Definition Classes
    Results
  53. def toString(): String

    Definition Classes
    AnyRef → Any
  54. implicit def tripletFunctionToMatcher[T](f: (T) ⇒ (Boolean, String, String)): Matcher[T]

    This method transform a function returning a triplet (Boolean, String for ok message, String for ko message) to a Matcher

  55. implicit def verifyFunction[U, T](t: (U) ⇒ MatchResult[T]): MatchResultFunctionVerification[U, T]

  56. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from MatchResultImplicits

Inherited from MatchResultCombinators

Inherited from ResultLogicalCombinators

Inherited from Results

Inherited from MatchResultLogicalCombinators

Inherited from Expectations

Inherited from CanBeEqual

Inherited from AnyRef

Inherited from Any

Ungrouped