Skip to content

Commit

Permalink
test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanapriya2308 authored Jul 21, 2023
1 parent 8c4b497 commit c9baeef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/initialize_data_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def test_parse_integer_string

refute(JSON::Validator.validate(schema, data, parse_data: false))

refute(JSON::Validator.validate(schema, data, parse_integer: false))

assert(JSON::Validator.validate(schema, data, json: true))

assert_raises(JSON::Schema::JsonLoadError) { JSON::Validator.validate(schema, data, uri: true) }
Expand Down Expand Up @@ -184,6 +186,10 @@ def test_parse_integer_string_with_instantiated_validator
assert_raises(JSON::Schema::ValidationError) { v.validate(data) }
assert_raises(JSON::Schema::ValidationError) { v.validate(data) }

v = JSON::Validator.new(schema, { parse_integer: false })
assert_raises(JSON::Schema::ValidationError) { v.validate(data) }
assert_raises(JSON::Schema::ValidationError) { v.validate(data) }

v = JSON::Validator.new(schema, { json: true })
assert(v.validate(data))
assert(v.validate(data))
Expand Down

0 comments on commit c9baeef

Please sign in to comment.