diff options
Diffstat (limited to 'test/psych/helper.rb')
-rw-r--r-- | test/psych/helper.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/psych/helper.rb b/test/psych/helper.rb index 498cdf8..26c77fb 100644 --- a/test/psych/helper.rb +++ b/test/psych/helper.rb @@ -70,9 +70,15 @@ module Psych def assert_cycle( obj ) v = Visitors::YAMLTree.create v << obj - assert_equal(obj, Psych.load(v.tree.yaml)) - assert_equal( obj, Psych::load(Psych.dump(obj))) - assert_equal( obj, Psych::load( obj.psych_to_yaml ) ) + if obj.nil? + assert_nil Psych.load(v.tree.yaml) + assert_nil Psych::load(Psych.dump(obj)) + assert_nil Psych::load( obj.psych_to_yaml ) + else + assert_equal(obj, Psych.load(v.tree.yaml)) + assert_equal( obj, Psych::load(Psych.dump(obj))) + assert_equal( obj, Psych::load( obj.psych_to_yaml ) ) + end end # |