Skip to content

Commit

Permalink
Refactor to omit JSON::GenericObject tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jan 10, 2025
1 parent abe144c commit 89eca76
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/json/json_generic_object_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
require_relative 'test_helper'

class JSONGenericObjectTest < Test::Unit::TestCase
include JSON

def setup
@go = GenericObject[ :a => 1, :b => 2 ]
if defined?(GenericObject)
@go = JSON::GenericObject[ :a => 1, :b => 2 ]
else
omit("JSON::GenericObject is not available")
end
end

def test_attributes
Expand Down Expand Up @@ -46,7 +49,7 @@ def test_parse_json
end

def test_from_hash
result = GenericObject.from_hash(
result = JSON::GenericObject.from_hash(
:foo => { :bar => { :baz => true }, :quux => [ { :foobar => true } ] })
assert_kind_of GenericObject, result.foo
assert_kind_of GenericObject, result.foo.bar
Expand Down Expand Up @@ -79,4 +82,4 @@ def switch_json_creatable
ensure
JSON::GenericObject.json_creatable = false
end
end if defined?(JSON::GenericObject)
end

0 comments on commit 89eca76

Please sign in to comment.