File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,21 @@ def test_parse_invalid_uri_string
9696 assert_raises ( JSON ::Schema ::JsonLoadError ) { JSON ::Validator . validate ( schema , data , :uri => true ) }
9797 end
9898
99+ def test_parse_invalid_scheme_string
100+ schema = { 'type' => 'string' }
101+ data = 'pick one: [1, 2, 3]'
102+
103+ assert ( JSON ::Validator . validate ( schema , data ) )
104+
105+ assert ( JSON ::Validator . validate ( schema , data , :parse_data => false ) )
106+
107+ assert_raises ( JSON ::Schema ::JsonParseError ) do
108+ JSON ::Validator . validate ( schema , data , :json => true )
109+ end
110+
111+ assert_raises ( JSON ::Schema ::UriError ) { JSON ::Validator . validate ( schema , data , :uri => true ) }
112+ end
113+
99114 def test_parse_integer
100115 schema = { 'type' => 'integer' }
101116 data = 42
You can’t perform that action at this time.
0 commit comments