Sha256: 0fbe83c2197984f758102a11b639ea3267e98a9602d7dbb2654b184e4e3e901c

Contents?: true

Size: 469 Bytes

Versions: 6

Compression:

Stored size: 469 Bytes

Contents

require "govuk_schemas/validator"

module GovukSchemas
  module RSpecMatchers
    %w[links frontend publisher notification].each do |schema_type|
      RSpec::Matchers.define "be_valid_against_#{schema_type}_schema".to_sym do |schema_name|
        match do |item|
          @validator = GovukSchemas::Validator.new(schema_name, schema_type, item)
          @validator.valid?
        end

        failure_message { @validator.error_message }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
govuk_schemas-5.0.4 lib/govuk_schemas/rspec_matchers.rb
govuk_schemas-5.0.3 lib/govuk_schemas/rspec_matchers.rb
govuk_schemas-5.0.0 lib/govuk_schemas/rspec_matchers.rb
govuk_schemas-4.7.0 lib/govuk_schemas/rspec_matchers.rb
govuk_schemas-4.6.0 lib/govuk_schemas/rspec_matchers.rb
govuk_schemas-4.5.0 lib/govuk_schemas/rspec_matchers.rb