A matcher over com.wix.accord.GroupViolations.
A matcher over com.wix.accord.GroupViolations. To generate a violation rule "pattern", call the constructor with the required predicates, for example:
val firstNameNotEmpty =
RuleViolationMatcher( path = Path( Generic( "firstName" ) ), constraint = "must not be empty" )
val lastNameNotEmpty =
RuleViolationMatcher( path = Path( Generic( "lastName" ) ), constraint = "must not be empty" )
val orPredicateFailed =
GroupViolationMatcher( constraint = "doesn't meet any of the requirements",
violations = firstNameNotEmpty :: lastNameNotEmpty :: Nil )
val validationResult: Result = ...
validationResult must failWith( orPredicateFailed )
A predicate specifying the object under validation.
A predicate specifying the constraint being violated.
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.
A predicate specifying the path of the object being validated.
The set of violations that comprise the group being validated.
com.wix.accord.GroupViolation
A matcher over validation com.wix.accord.Results.
A matcher over validation com.wix.accord.Results. Takes a set of expected violations and return a suitable match result in case of failure.
The set of expected violations for this matcher.
A matcher over com.wix.accord.RuleViolations.
A matcher over com.wix.accord.RuleViolations. To generate a violation rule "pattern", call the constructor with the required predicates, for example:
val firstNameNotEmpty =
RuleViolationMatcher( description = Path( Generic( "firstName" ) ), constraint = "must not be empty" )
val validationResult: Result = ...
validationResult must failWith( firstNameNotEmpty )
A predicate specifying the object under validation.
A predicate specifying the constraint being violated.
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.
A predicate specifying the path to the object being validated.
com.wix.accord.RuleViolation
Abstracts over validators for the various violation type.
Abstracts over validators for the various violation type.
Enables syntax like someResult should be( aFailure )
Enables syntax like someResult should be( aFailure )
Enables syntax like someResult should be( aSuccess )
Enables syntax like someResult should be( aSuccess )
A convenience method for matching failures.
A convenience method for matching failures. Enables syntax like:
val result: Result = ...
result should failWith(
Path( Generic( "firstName" ) ) -> "must not be empty",
Path( Generic( "lastName" ) ) -> "must not be empty"
)
The set of expected violations.
A matcher over validation com.wix.accord.Results.
A convenience method for matching violation groups.
A convenience method for matching violation groups. Enables syntax like:
val result: Result = ...
result should failWith( group( Path( Generic( "teacher" ) ), "is invalid", // The group context
Path( Generic( "firstName ) ) -> "must not be empty" ) ) // The rule violations
A predicate specifying the path to the object being validated.
A textual description of the constraint being violated (for example, "must not be empty").
The set of expected violations that comprise the group.
A matcher over com.wix.accord.GroupViolations.
A convenience method for matching violation groups.
A convenience method for matching violation groups. Enables syntax like:
val result: Result = ...
result should failWith( group( Path( Generic( "teacher" ) ), "is invalid", // The group context
Path( Generic( "firstName ) ) -> "must not be empty" ) ) // The rule violations
A predicate specifying the path to the object being validated.
A textual description of the constraint being violated (for example, "must not be empty").
The set of expected violations that comprise the group.
A matcher over com.wix.accord.GroupViolations.
A convenience implicit to simplify test code.
A convenience implicit to simplify test code. Enables syntax like:
val rule: RuleViolationMatcher = Path( Generic( "firstName" ) )
// ... which is equivalent to
val rule = RuleViolationMatcher( path = Path( Generic( "firstName" ) ) )
A convenience implicit to simplify test code.
A convenience implicit to simplify test code. Enables syntax like:
val rule: RuleViolationMatcher = Path( Generic( "firstName" ) ) -> "must not be empty"
// ... which is equivalent to
val rule = RuleViolationMatcher( path = Path( Generic( "firstName" ) ), constraint = "must not be empty" )
This method has been deprecated in favor of macro assertion and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assertion and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assumption and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assumption and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
A convenience implicit to simplify test code.
A convenience implicit to simplify test code. Enables syntax like:
val rule: RuleViolationMatcher = Generic( "firstName" )
// ... which is equivalent to
val rule = RuleViolationMatcher( path = Path( Generic( "firstName" ) ) )
(Since version 0.7)
A convenience implicit to simplify test code.
A convenience implicit to simplify test code. Enables syntax like:
val rule: RuleViolationMatcher = Generic( "firstName" ) -> "must not be empty"
// ... which is equivalent to
val rule = RuleViolationMatcher( path = Path( Generic( "firstName" ) ), constraint = "must not be empty" )
(Since version 0.7)
Please use 'an [Exception] should be thrownBy { ... }' syntax instead
This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of assertResult instead.
This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of assertResult instead.
This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.
This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.
A convenience method for matching violation groups.
A convenience method for matching violation groups. Enables syntax like:
val result: Result = ...
result should failWith( group( "teacher", "is invalid", // The group context
"firstName" -> "must not be empty" ) ) // The rule violations
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.
A textual description of the constraint being violated (for example, "must not be empty").
The set of expected violations that comprise the group.
A matcher over com.wix.accord.GroupViolations.
(Since version 0.6) Intended for backwards compatibility. It is recommended to match against paths instead.
A convenience method for matching violation groups.
A convenience method for matching violation groups. Enables syntax like:
val result: Result = ...
result should failWith( group( "teacher", "is invalid", // The group context
"firstName" -> "must not be empty" ) ) // The rule violations
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.
A textual description of the constraint being violated (for example, "must not be empty").
The set of expected violations that comprise the group.
A matcher over com.wix.accord.GroupViolations.
(Since version 0.6) Intended for backwards compatibility. It is recommended to match against paths instead.
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" )
(Since version 0.6)
An opinionated helper trait for combinator specifications. The recommended practice for defining new combinators is test-first via this specification: