Skip to content

AVD::Spec::ConstraintValidatorTestCase cannot handle constraints that require a validator from context #142

@Blacksmoke16

Description

@Blacksmoke16

AVD::Spec::ConstraintValidatorTestCase leverages the AVD::Spec::MockValidator type. Because of this, if a constraint uses the validator off the context it wouldn't actually run those violations causing the specs to not pass since it thinks there are no violations. An example of this is the ISIN constraint.

This constraint should be updated to remove the validator ivar with something like self.context.validator.validate(number, AVD::Constraints::Luhn.new).empty?. But we'll also need to handle this somehow in the specs. TBD on how to do that given we can't just mock the values it returns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions