test/test_fragment_resolution.rb in json-schema-2.4.1 vs test/test_fragment_resolution.rb in json-schema-2.5.0
- old
+ new
@@ -1,9 +1,8 @@
-require 'test/unit'
-require File.dirname(__FILE__) + '/../lib/json-schema'
+require File.expand_path('../test_helper', __FILE__)
-class FragmentResolution < Test::Unit::TestCase
+class FragmentResolution < Minitest::Test
def test_fragment_resolution
schema = {
"$schema" => "http://json-schema.org/draft-04/schema#",
"required" => ["a"],
"properties" => {
@@ -15,17 +14,17 @@
}
}
}
data = {"b" => 5}
- assert(!JSON::Validator.validate(schema,data))
- assert(JSON::Validator.validate(schema,data,:fragment => "#/properties/a"))
+ refute_valid schema, data
+ assert_valid schema, data, :fragment => "#/properties/a"
- assert_raise JSON::Schema::SchemaError do
+ assert_raises JSON::Schema::SchemaError do
JSON::Validator.validate!(schema,data,:fragment => "/properties/a")
end
- assert_raise JSON::Schema::SchemaError do
+ assert_raises JSON::Schema::SchemaError do
JSON::Validator.validate!(schema,data,:fragment => "#/properties/b")
end
end
end