aboutsummaryrefslogtreecommitdiffstats
path: root/test/psych/test_merge_keys.rb
blob: 9aadcc85e5050e734095d3453f2540d8a949e561 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require_relative 'helper'

module Psych
  class TestMergeKeys < TestCase
    # [ruby-core:34679]
    def test_merge_key
      yaml = <<-eoyml
foo: &foo
  hello: world
bar:
  << : *foo
  baz: boo
      eoyml

      hash = {
        "foo" => { "hello" => "world"},
        "bar" => { "hello" => "world", "baz" => "boo" } }
      assert_equal hash, Psych.load(yaml)
    end
  end
end