Sha256: cf3cfb30f5b5948b476e27bc6da8519004b275e040c9df57ee012b83c7ff250f
Contents?: true
Size: 716 Bytes
Versions: 11
Compression:
Stored size: 716 Bytes
Contents
require 'test/unit' require File.dirname(__FILE__) + '/../lib/json-schema' class RubySchemaTest < Test::Unit::TestCase def test_string_keys schema = { "type" => 'object', "required" => ["a"], "properties" => { "a" => {"type" => "integer", "default" => 42}, "b" => {"type" => "integer"} } } data = { "a" => 5 } assert(JSON::Validator.validate(schema, data)) end def test_symbol_keys schema = { type: 'object', required: ["a"], properties: { a: {type: "integer", default: 42}, b: {type: "integer"} } } data = { a: 5 } assert(JSON::Validator.validate(schema, data)) end end
Version data entries
11 entries across 11 versions & 2 rubygems