Sha256: 906aa5c3f9be24ea36850881f31812a18d2cb049bf8c2fceece6d5b32564668c

Contents?: true

Size: 532 Bytes

Versions: 3

Compression:

Stored size: 532 Bytes

Contents

module Longleaf
  module ConfigValidatorHelpers
    def fails_validation_with_error(validator, *error_messages)
      result = validator.validate_config
      expect(result.valid?).to be false
      error_messages.each do |error_message|
        expect(result.errors).to include(error_message)
      end
    end

    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
longleaf-1.1.1 lib/longleaf/specs/config_validator_helpers.rb
longleaf-1.1.0 lib/longleaf/specs/config_validator_helpers.rb
longleaf-1.0.0 lib/longleaf/specs/config_validator_helpers.rb