summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_merge_keys.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/psych/test_merge_keys.rb b/test/psych/test_merge_keys.rb
index d8baba485f..ba8d2e77b3 100644
--- a/test/psych/test_merge_keys.rb
+++ b/test/psych/test_merge_keys.rb
@@ -2,6 +2,24 @@ require_relative 'helper'
module Psych
class TestMergeKeys < TestCase
+ class Product
+ attr_reader :bar
+ end
+
+ def test_mergekey_with_object
+ s = <<-eoyml
+foo: &foo
+ bar: 10
+product:
+ !ruby/object:#{Product.name}
+ <<: *foo
+ eoyml
+ hash = Psych.load s
+ assert_equal({"bar" => 10}, hash["foo"])
+ product = hash["product"]
+ assert_equal 10, product.bar
+ end
+
def test_merge_nil
yaml = <<-eoyml
defaults: &defaults