Sha256: 267f20c284ca691f63d6214cbafc14ebe1c1807517967b325fb5a8fcc3b7d72f
Contents?: true
Size: 633 Bytes
Versions: 2
Compression:
Stored size: 633 Bytes
Contents
require "spec_helper" describe "deep merge" do before do class Test::Foo < Evil::Struct attribute :foo attribute :bar end end let(:struct) do Test::Foo.new foo: { bar: [{ foo: :FOO }] }, bar: { baz: :FOO, qux: :QUX } end let(:result) do struct.merge_deeply foo: { bar: [{ qux: :QUX }] }, bar: { "qux" => :FOO } end it "works" do expect { result }.not_to change { struct } expect(result).to be_instance_of Test::Foo expect(result).to eq foo: { bar: [{ qux: :QUX }] }, bar: { baz: :FOO, qux: :FOO } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
evil-struct-0.0.4 | spec/features/deep_merge_spec.rb |
evil-struct-0.0.3 | spec/features/deep_merge_spec.rb |