File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 22require_relative 'test_helper'
33
44class 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
You can’t perform that action at this time.
0 commit comments