struct Athena::Validator::Spec::ConstraintValidatorTestCase::Assertion
- Athena::Validator::Spec::ConstraintValidatorTestCase::Assertion
- Struct
- Value
- Object
Overview
Used to assert that a violation added via the AVD::ConstraintValidatorInterface
was built as expected.
NOTE This type should not be instantiated directly, use AVD::Spec::ConstraintValidatorTestCase#build_violation
instead.
Defined in:
spec/constraint_validator_test_case.crConstructors
Instance Method Summary
-
#add_parameter(key : String, value : _) : self
Adds the provided key value pair to the expected violations'
AVD::Violation::ConstraintViolationInterface#parameters
. -
#assert_violation(*, file : String = __FILE__, line : Int32 = __LINE__) : Nil
Asserts that the violation added to the context equals the violation built via
self
. -
#at_path(property_path : String) : self
Sets the
AVD::Violation::ConstraintViolationInterface#property_path
on the expected violation. -
#cause(cause : String | Nil) : self
Sets the
AVD::Violation::ConstraintViolationInterface#cause
on the expected violation. - #clone
-
#code(code : String | Nil) : self
Sets the
AVD::Violation::ConstraintViolationInterface#code
on the expected violation. - #constraint : AVD::Constraint
- #context : AVD::ExecutionContextInterface
- #copy_with(context _context = @context, message _message = @message, constraint _constraint = @constraint)
-
#invalid_value(value : _) : self
Sets the
AVD::Violation::ConstraintViolationInterface#invalid_value
on the expected violation. - #message : String
-
#plural(plural : Int32) : self
Sets the
AVD::Violation::ConstraintViolationInterface#plural
on the expected violation.
Constructor Detail
Instance Method Detail
Adds the provided key value pair to the expected violations' AVD::Violation::ConstraintViolationInterface#parameters
.
Returns self
for chaining.
Asserts that the violation added to the context equals the violation built via self
.
Sets the AVD::Violation::ConstraintViolationInterface#property_path
on the expected violation.
Returns self
for chaining.
Sets the AVD::Violation::ConstraintViolationInterface#cause
on the expected violation.
Returns self
for chaining.
Sets the AVD::Violation::ConstraintViolationInterface#code
on the expected violation.
Returns self
for chaining.
Sets the AVD::Violation::ConstraintViolationInterface#invalid_value
on the expected violation.
Returns self
for chaining.
Sets the AVD::Violation::ConstraintViolationInterface#plural
on the expected violation.
Returns self
for chaining.