Skip to content

Commit 6843ccf

Browse files
authored
Merge pull request #726 from ruby/support-bundled-gems
Refactor to omit JSON::GenericObject tests
2 parents abe144c + 89eca76 commit 6843ccf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/json/json_generic_object_test.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
require_relative 'test_helper'
33

44
class JSONGenericObjectTest < Test::Unit::TestCase
5-
include JSON
65

76
def setup
8-
@go = GenericObject[ :a => 1, :b => 2 ]
7+
if defined?(GenericObject)
8+
@go = JSON::GenericObject[ :a => 1, :b => 2 ]
9+
else
10+
omit("JSON::GenericObject is not available")
11+
end
912
end
1013

1114
def test_attributes
@@ -46,7 +49,7 @@ def test_parse_json
4649
end
4750

4851
def test_from_hash
49-
result = GenericObject.from_hash(
52+
result = JSON::GenericObject.from_hash(
5053
:foo => { :bar => { :baz => true }, :quux => [ { :foobar => true } ] })
5154
assert_kind_of GenericObject, result.foo
5255
assert_kind_of GenericObject, result.foo.bar
@@ -79,4 +82,4 @@ def switch_json_creatable
7982
ensure
8083
JSON::GenericObject.json_creatable = false
8184
end
82-
end if defined?(JSON::GenericObject)
85+
end

0 commit comments

Comments
 (0)