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. implicit class AdaptFunction[T, S] extends AnyRef

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

  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. implicit class InvariantMatcherFunction[T] extends AnyRef

  6. class MatchResultCombinator[T] extends AnyRef

    Definition Classes
    MatchResultLogicalCombinators
  7. implicit class MatcherFunction[S, 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.

  11. implicit class matcherContainResult[T] extends AnyRef

  12. implicit class resultFunction[T, R] extends AnyRef

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

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. final def asInstanceOf[T0]: T0

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

    implicit definition to transform any MatchResult to a Result

    implicit definition to transform any MatchResult to a Result

    Definition Classes
    MatchResultImplicits
  8. def atLeastOnce[T](matcher: Matcher[T]): ContainWithResult[T]

    apply a matcher atLeast one value

  9. def atLeastOnce[T, R](values: GenTraversableOnce[T])(f: (T) ⇒ R)(implicit arg0: AsResult[R]): MatchResult[GenTraversableOnce[T]]

    verify the function f for at least one value

  10. def atLeastOnceWhen[T, R](values: GenTraversable[T])(f: PartialFunction[T, R])(implicit arg0: AsResult[R]): MatchResult[GenTraversableOnce[T]]

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

  11. def atMostOnce[T](matcher: Matcher[T]): ContainWithResult[T]

    apply a matcher atLeast one value

  12. def atMostOnce[T, R](values: GenTraversableOnce[T])(f: (T) ⇒ R)(implicit arg0: AsResult[R]): MatchResult[GenTraversableOnce[T]]

    verify the function f for at least one value

  13. def atMostOnceWhen[T, R](values: GenTraversable[T])(f: PartialFunction[T, R])(implicit arg0: AsResult[R]): MatchResult[GenTraversableOnce[T]]

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

  14. 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
  15. 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
  16. 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
  17. 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
  18. def clone(): AnyRef

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

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

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

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

    returns

    an Expectable with a description function

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

    returns

    an Expectable with a description function

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

    returns

    an Expectable with a description

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

    returns

    an Expectable

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

    returns

    an Expectable with a function to show the element T

    Definition Classes
    Expectations
  27. 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
  28. implicit def describeExpectation(description: String): ExpectationDescription

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  32. def forall[T](matcher: Matcher[T]): ContainWithResult[T]

    apply a matcher for all values

  33. def forall[T, R](values: GenTraversableOnce[T])(f: (T) ⇒ R)(implicit arg0: AsResult[R]): MatchResult[GenTraversableOnce[T]]

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

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

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

  35. def foreach[T](matcher: Matcher[T]): ContainWithResult[T]

    apply a matcher foreach value

  36. def foreach[T, R](values: GenTraversableOnce[T])(f: (T) ⇒ R)(implicit arg0: AsResult[R]): MatchResult[GenTraversableOnce[T]]

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

  37. def foreachWhen[T, R](values: GenTraversable[T])(f: PartialFunction[T, R])(implicit arg0: AsResult[R]): MatchResult[GenTraversableOnce[T]]

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

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

    This method transform a function to a Matcher

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

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

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

    This method transform a function to a Matcher

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

    This method transform a function to a Matcher

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

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

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

    Definition Classes
    Any
  46. 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
  47. implicit def matchResultAsResult[M[_] <: MatchResult[_]]: AsResult[M[_]]

    implicit typeclass instance to create examples from MatchResults

    implicit typeclass instance to create examples from MatchResults

    Definition Classes
    MatchResultImplicits
  48. implicit def matchResultFunctionToMatcher[T, R](f: (T) ⇒ R)(implicit arg0: AsResult[R]): Matcher[T]

    This method transform a function returning a Result to a Matcher

  49. 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
  50. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  51. def negate(r: Result): Result

    Definition Classes
    Results
  52. 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
  53. lazy val negationsTable: BiMap[String, String]

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

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

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

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

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

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

  62. final def wait(): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. 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