Sha256: 50efbb4d6d161e8094f2aea28daf9ac4a265d203078aae92358c75dac6a65707
Contents?: true
Size: 614 Bytes
Versions: 11
Compression:
Stored size: 614 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Hash, 'deep_merge' do let(:hash) { { :a => 'a', :b => "b", :c => {:c1 => "c1", :c2 => "c2", :c3 => {:d1 => "d1"} } } } let(:other_hash) { { :a => 1, :b => "b", :c => {:c1 => 2, :c2 => "c2", :c3 => {:d1 => "d1", :d2 => "d2"} } } } subject { hash.deep_merge(other_hash) } it { expect(subject[:a]).to eql(1) } it { expect(subject[:b]).to eql("b") } it { expect(subject[:c][:c1]).to eql(2) } it { expect(subject[:c][:c2]).to eql("c2") } it { expect(subject[:c][:c3][:d1]).to eql("d1") } it { expect(subject[:c][:c3][:d2]).to eql("d2") } end
Version data entries
11 entries across 11 versions & 1 rubygems