summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-03-03 15:25:38 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-03-03 15:25:38 +0900
commit8e6420c8fa6819e67e0f2ef6c456314c96826048 (patch)
treef70e669438e9af2be6244e304d9f0cec907124bd
parentb0bbb2f2884dcfc731bb61e59c962d91e558b378 (diff)
downloadpsych-8e6420c8fa6819e67e0f2ef6c456314c96826048.tar.gz
avoid to deprecated warnings with nil assertions.
-rw-r--r--test/psych/helper.rb12
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
#