diff options
author | Florian Frank <flori@ping.de> | 2012-04-27 19:49:20 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2012-04-27 20:24:12 +0200 |
commit | 7f64f211d36e598a3c54a19d9caad9e3f9dca402 (patch) | |
tree | 90893175a786ff0cf90b63aba05ab6cc11b2387b /tests | |
parent | 7c6e8cd98fb7d841f08e083040b8316f7c752157 (diff) | |
download | json-7f64f211d36e598a3c54a19d9caad9e3f9dca402.tar.gz |
Throw exception unless source is a string
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_json.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_json.rb b/tests/test_json.rb index 7beaaac..4b4bc55 100755 --- a/tests/test_json.rb +++ b/tests/test_json.rb @@ -109,6 +109,8 @@ class TestJSON < Test::Unit::TestCase def test_parse_json_primitive_values assert_raise(JSON::ParserError) { JSON.parse('') } assert_raise(JSON::ParserError) { JSON.parse('', :quirks_mode => true) } + assert_raise(TypeError) { JSON::Parser.new(nil).parse } + assert_raise(TypeError) { JSON::Parser.new(nil, :quirks_mode => true).parse } assert_raise(TypeError) { JSON.parse(nil) } assert_raise(TypeError) { JSON.parse(nil, :quirks_mode => true) } assert_raise(JSON::ParserError) { JSON.parse(' /* foo */ ') } |