Skip to content

class Athena::Validator::Spec::MockContextualValidator
inherits Reference #

A spec implementation of AVD::Validator::ContextualValidatorInterface.

Allows settings the violations that should be returned, defaulting to no violations.

Included modules

Athena::Validator::Validator::ContextualValidatorInterface

Constructors#

.new(violations : AVD::Violation::ConstraintViolationListInterface = AVD::Violation::ConstraintViolationList.new)#

View source

Methods#

#at_path(path : String) : AVD::Validator::ContextualValidatorInterface#

Appends the provided path to the current AVD::ExecutionContextInterface#property_path.

View source

#validate(value : _, constraints : Array(AVD::Constraint) | AVD::Constraint | Nil = nil, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Validator::ContextualValidatorInterface#

:inherit:

View source

#validate_property(object : AVD::Validatable, property_name : String, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Validator::ContextualValidatorInterface#

:inherit:

View source

#validate_property_value(object : AVD::Validatable, property_name : String, value : _, groups : Array(String) | String | AVD::Constraints::GroupSequence | Nil = nil) : AVD::Validator::ContextualValidatorInterface#

:inherit:

View source

#violations : AVD::Violation::ConstraintViolationListInterface#

Returns any violations that have been generated so far in the context of self.

View source