com.wix.accord.scalatest

ResultMatchers

trait ResultMatchers extends AnyRef

Extends a test suite with a set of matchers over validation com.wix.accord.Results.

Self Type
ResultMatchers with Suite
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ResultMatchers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class GroupViolationMatcher(value: Any = null, constraint: String = null, legacyDescription: String = null, description: Description = null, violations: Set[(ResultMatchers.this)#ViolationMatcher] = null) extends (ResultMatchers.this)#ViolationMatcher with Product with Serializable

    A matcher over com.wix.accord.GroupViolations.

  2. case class ResultMatcher(expectedViolations: Set[(ResultMatchers.this)#ViolationMatcher]) extends Matcher[Result] with Product with Serializable

    A matcher over validation com.wix.accord.Results.

  3. case class RuleViolationMatcher(value: Any = null, constraint: String = null, legacyDescription: String = null, description: Description = null) extends (ResultMatchers.this)#ViolationMatcher with Product with Serializable

    A matcher over com.wix.accord.RuleViolations.

  4. sealed trait ViolationMatcher extends Matcher[Violation]

    Abstracts over validators for the various violation type.

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. val aFailure: BeMatcher[Result]

    Enables syntax like someResult should be( aFailure )

  7. val aSuccess: BeMatcher[Result]

    Enables syntax like someResult should be( aSuccess )

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. implicit def description2RuleViolationMatcher(desc: Description): (ResultMatchers.this)#RuleViolationMatcher

  11. implicit def descriptionAndConstraintTuple2RuleMatcher(v: (Description, String)): (ResultMatchers.this)#RuleViolationMatcher

    A convenience implicit to simplify test code.

    A convenience implicit to simplify test code. Enables syntax like:

    val rule: RuleViolationMatcher = AccessChain( "firstName" ) -> "must not be empty" // ... which is equivalent to val rule = RuleViolationMatcher( description = AccessChain( "firstName" ), constraint = "must not be empty" )

  12. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  14. def failWith(expectedViolations: (ResultMatchers.this)#ViolationMatcher*): Matcher[Result]

    A convenience method for matching failures.

    A convenience method for matching failures. Enables syntax like:

    val result: Result = ... result should failWith( AccessChain( "firstName" ) -> "must not be empty", AccessChain( "lastName" ) -> "must not be empty" )

    expectedViolations

    The set of expected violations.

    returns

    A matcher over validation com.wix.accord.Results.

  15. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  17. def group[T](description: Description, constraint: String, expectedViolations: T*)(implicit ev: (T) ⇒ (ResultMatchers.this)#RuleViolationMatcher): (ResultMatchers.this)#GroupViolationMatcher

  18. def group(description: Description, constraint: String, expectedViolations: (Description, String)*): (ResultMatchers.this)#GroupViolationMatcher

    A convenience method for matching violation groups.

    A convenience method for matching violation groups. Enables syntax like:

    val result: Result = ... result should failWith( group( AccessChain( "teacher" ), "is invalid", // The group context AccessChain( "firstName ) -> "must not be empty" ) ) // The rule violations

    description

    A predicate specifying the description of the object being validated.

    constraint

    A textual description of the constraint being violated (for example, "must not be empty").

    expectedViolations

    The set of expected violations that comprise the group.

    returns

    A matcher over com.wix.accord.GroupViolations.

  19. def hashCode(): Int

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

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

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

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

    Definition Classes
    AnyRef
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def group[T](legacyDescription: String, constraint: String, expectedViolations: T*)(implicit ev: (T) ⇒ (ResultMatchers.this)#RuleViolationMatcher): (ResultMatchers.this)#GroupViolationMatcher

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6) Intended for backwards compatibility. It is recommended to match against Description types instead.

  2. def group(legacyDescription: String, constraint: String, expectedViolations: (String, String)*): (ResultMatchers.this)#GroupViolationMatcher

    A convenience method for matching violation groups.

    A convenience method for matching violation groups. Enables syntax like:

    val result: Result = ... result should failWith( group( AccessChain( "teacher" ), "is invalid", // The group context AccessChain( "firstName ) -> "must not be empty" ) ) // The rule violations

    legacyDescription

    Retained for backwards compatibility; matches against the rendered description of the object being validated. See com.wix.accord.Descriptions.render for details of how descriptions are rendered into strings.

    constraint

    A textual description of the constraint being violated (for example, "must not be empty").

    expectedViolations

    The set of expected violations that comprise the group.

    returns

    A matcher over com.wix.accord.GroupViolations.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6) Intended for backwards compatibility. It is recommended to match against Description types instead.

  3. implicit def stringTuple2RuleMatcher(v: (String, String)): (ResultMatchers.this)#RuleViolationMatcher

    A convenience implicit to simplify test code.

    A convenience implicit to simplify test code. Enables syntax like:

    val rule: RuleViolationMatcher = "firstName" -> "must not be empty" // ... which is equivalent to val rule = RuleViolationMatcher( legacyDescription = "firstName", constraint = "must not be empty" )

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6)

Inherited from AnyRef

Inherited from Any

Ungrouped