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 @@ -56,6 +56,21 @@ def test_parse_json_string
5656 assert_raises ( JSON ::Schema ::JsonLoadError ) { JSON ::Validator . validate ( schema , data , :uri => true ) }
5757 end
5858
59+ def test_parse_plain_text_string
60+ schema = { 'type' => 'string' }
61+ data = 'kapow'
62+
63+ assert ( JSON ::Validator . validate ( schema , data ) )
64+
65+ assert ( JSON ::Validator . validate ( schema , data , :parse_data => false ) )
66+
67+ assert_raises ( JSON ::Schema ::JsonParseError ) do
68+ JSON ::Validator . validate ( schema , data , :json => true )
69+ end
70+
71+ assert_raises ( JSON ::Schema ::JsonLoadError ) { JSON ::Validator . validate ( schema , data , :uri => true ) }
72+ end
73+
5974 def test_parse_valid_uri_string
6075 schema = { 'type' => 'string' }
6176 data = 'http://foo.bar/'
You can’t perform that action at this time.
0 commit comments