Skip to content

Commit 7a2a24d

Browse files
etiennebarriebyroot
andcommitted
Fix JSON::GenericObject tests
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
1 parent 1397bf8 commit 7a2a24d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/json/json_generic_object_test.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class JSONGenericObjectTest < Test::Unit::TestCase
55

66
def setup
7-
if defined?(GenericObject)
7+
if defined?(JSON::GenericObject)
88
@go = JSON::GenericObject[ :a => 1, :b => 2 ]
99
else
1010
omit("JSON::GenericObject is not available")
@@ -40,23 +40,23 @@ def test_parse_json
4040
)
4141
assert_equal 1, l.a
4242
assert_equal @go,
43-
l = JSON('{ "a": 1, "b": 2 }', :object_class => GenericObject)
43+
l = JSON('{ "a": 1, "b": 2 }', :object_class => JSON::GenericObject)
4444
assert_equal 1, l.a
45-
assert_equal GenericObject[:a => GenericObject[:b => 2]],
46-
l = JSON('{ "a": { "b": 2 } }', :object_class => GenericObject)
45+
assert_equal JSON::GenericObject[:a => JSON::GenericObject[:b => 2]],
46+
l = JSON('{ "a": { "b": 2 } }', :object_class => JSON::GenericObject)
4747
assert_equal 2, l.a.b
4848
end
4949
end
5050

5151
def test_from_hash
5252
result = JSON::GenericObject.from_hash(
5353
:foo => { :bar => { :baz => true }, :quux => [ { :foobar => true } ] })
54-
assert_kind_of GenericObject, result.foo
55-
assert_kind_of GenericObject, result.foo.bar
54+
assert_kind_of JSON::GenericObject, result.foo
55+
assert_kind_of JSON::GenericObject, result.foo.bar
5656
assert_equal true, result.foo.bar.baz
57-
assert_kind_of GenericObject, result.foo.quux.first
57+
assert_kind_of JSON::GenericObject, result.foo.quux.first
5858
assert_equal true, result.foo.quux.first.foobar
59-
assert_equal true, GenericObject.from_hash(true)
59+
assert_equal true, JSON::GenericObject.from_hash(true)
6060
end
6161

6262
def test_json_generic_object_load

0 commit comments

Comments
 (0)