summaryrefslogtreecommitdiff
path: root/test/psych/helper.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-05 13:16:32 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-05 13:16:32 +0000
commit6d77e28763ed17f75edf3b4072701b4dbd7644bb (patch)
treee56f68d61222a1cf4bfc6a63aa640c6546a41b91 /test/psych/helper.rb
parent4389ba641f89fe9d4e5c575442968d385c4183e8 (diff)
Import psych-3.0.0.beta1 from ruby/psych.
* Removed deprecated code. * Removed code related syck gem. * Fixed typos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/helper.rb')
-rw-r--r--test/psych/helper.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/psych/helper.rb b/test/psych/helper.rb
index 498cdf8b09..7b564bd2d7 100644
--- a/test/psych/helper.rb
+++ b/test/psych/helper.rb
@@ -50,10 +50,10 @@ module Psych
def assert_to_yaml( obj, yaml )
assert_equal( obj, Psych::load( yaml ) )
assert_equal( obj, Psych::parse( yaml ).transform )
- assert_equal( obj, Psych::load( obj.psych_to_yaml ) )
- assert_equal( obj, Psych::parse( obj.psych_to_yaml ).transform )
+ assert_equal( obj, Psych::load( obj.to_yaml ) )
+ assert_equal( obj, Psych::parse( obj.to_yaml ).transform )
assert_equal( obj, Psych::load(
- obj.psych_to_yaml(
+ obj.to_yaml(
:UseVersion => true, :UseHeader => true, :SortKeys => true
)
))
@@ -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.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.to_yaml))
+ end
end
#