Sha256: d7cfc5d7659b09ee1002156e4ac3cbe4c50aa9437558536310a5b1a4ff480400
Contents?: true
Size: 587 Bytes
Versions: 4
Compression:
Stored size: 587 Bytes
Contents
require File.expand_path('../test_helper', __FILE__) class ListOptionTest < Minitest::Test def test_list_option_reusing_schemas schema_hash = { "$schema" => "http://json-schema.org/draft-04/schema#", "type" => "object", "properties" => { "a" => { "type" => "integer" } } } uri = Addressable::URI.parse('http://example.com/item') schema = JSON::Schema.new(schema_hash, uri) JSON::Validator.add_schema(schema) data = {"a" => 1} assert_valid uri.to_s, data data = [{"a" => 1}] assert_valid uri.to_s, data, :list => true end end
Version data entries
4 entries across 4 versions & 2 rubygems