org.specs2.matcher

MatchersImplicits

trait MatchersImplicits extends Expectations with MatchResultCombinators with MatchResultImplicits with ExpectationsDescription

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
ExpectationsDescription, Sentences, MatchResultImplicits, MatchResultCombinators, ResultLogicalCombinators, Results, MatchResultLogicalCombinators, Expectations, CanBeEqual, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MatchersImplicits
  2. ExpectationsDescription
  3. Sentences
  4. MatchResultImplicits
  5. MatchResultCombinators
  6. ResultLogicalCombinators
  7. Results
  8. MatchResultLogicalCombinators
  9. Expectations
  10. CanBeEqual
  11. AnyRef
  12. 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 ExpectationDescription extends AnyRef

    Definition Classes
    ExpectationsDescription
  5. class MatchResultCombinator[T] extends AnyRef

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

  7. class MatcherFunction[S, T] extends AnyRef

  8. class MatcherFunction2[T] extends AnyRef

  9. class ResultLogicalCombinator extends AnyRef

    Definition Classes
    ResultLogicalCombinators
  10. 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.

  11. 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. implicit def describeExpectation(description: String): ExpectationDescription

    Definition Classes
    ExpectationsDescription
  26. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  29. 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

  30. 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

  31. 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

  32. 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

  33. 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
  34. implicit def functionAndKoMessageToMatcher[T](f: ((T) ⇒ Boolean, (T) ⇒ String)): Matcher[T]

    This method transform a function to a Matcher

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

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

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

    This method transform a function to a Matcher

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

    This method transform a function to a Matcher

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

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

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

    Definition Classes
    Any
  41. 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
  42. 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
  43. implicit def matchResultFunctionToMatcher[T](f: (T) ⇒ MatchResult[_]): Matcher[T]

    This method transform a function returning a MatchResult to a Matcher

  44. 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
  45. 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

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

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

    Definition Classes
    AnyRef
  48. def negateSentence(sentence: String): String

    replace the first occurrence of a verb in the negations table with its negation.

    replace the first occurrence of a verb in the negations table with its negation.

    We first try to negate an existing negation

    Definition Classes
    Sentences
  49. lazy val negationsTable: BiMap[String, String]

    Attributes
    protected
    Definition Classes
    Sentences
  50. final def notify(): Unit

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

    Definition Classes
    AnyRef
  52. 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

  53. 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
  54. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  55. 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
  56. def toString(): String

    Definition Classes
    AnyRef → Any
  57. 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

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

  59. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from ExpectationsDescription

Inherited from Sentences

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