Module: Longleaf::ConfigValidatorHelpers
- Defined in:
- lib/longleaf/specs/config_validator_helpers.rb
Instance Method Summary collapse
- #fails_validation_with_error(validator, *error_messages) ⇒ Object
- #passes_validation(validator) ⇒ Object
Instance Method Details
#fails_validation_with_error(validator, *error_messages) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/longleaf/specs/config_validator_helpers.rb', line 3 def fails_validation_with_error(validator, *) result = validator.validate_config expect(result.valid?).to be false .each do || expect(result.errors).to include() end end |
#passes_validation(validator) ⇒ Object
11 12 13 14 |
# File 'lib/longleaf/specs/config_validator_helpers.rb', line 11 def passes_validation(validator) result = validator.validate_config expect(result.valid?).to eq(true), "expected validation to pass, but received errors:\n#{result.errors&.join("\n")}" end |