Sha256: 6b95188af0d69322c5d640f8dda76e1b75ab59b1c73d5ca689858792539d0a03
Contents?: true
Size: 895 Bytes
Versions: 8
Compression:
Stored size: 895 Bytes
Contents
require "govuk_schemas/validator" module GovukSchemas module AssertMatchers def assert_valid_against_publisher_schema(payload, schema_name) assert_valid_against_schema(payload, schema_name, "publisher") end def assert_valid_against_links_schema(payload, schema_name) assert_valid_against_schema(payload, schema_name, "links") end def assert_valid_against_frontend_schema(payload, schema_name) assert_valid_against_schema(payload, schema_name, "frontend") end def assert_valid_against_notification_schema(payload, schema_name) assert_valid_against_schema(payload, schema_name, "notification") end private def assert_valid_against_schema(payload, schema_name, schema_type) validator = GovukSchemas::Validator.new(schema_name, schema_type, payload) assert validator.valid?, validator.error_message end end end
Version data entries
8 entries across 8 versions & 1 rubygems