module GovukContentSchemaTestHelpers::TestUnit

Public Instance Methods

assert_valid_against_schema(content_item_hash, format) click to toggle source
# File lib/govuk-content-schema-test-helpers/test_unit.rb, line 3
def assert_valid_against_schema(content_item_hash, format)
  validator = GovukContentSchemaTestHelpers::Validator.new(format, "schema", content_item_hash.to_json)
  assert validator.valid?, "JSON not valid against #{format} schema: #{validator.errors.to_s}"
end