Sha256: 845bead5ddf42f8c7511921cbb89bf2451261aab1caf765b7437e148664ed88b
Contents?: true
Size: 689 Bytes
Versions: 3
Compression:
Stored size: 689 Bytes
Contents
require 'spec_helper' describe JsonSchemaSpec::Util do describe "#deep_merge" do let(:input) do [ { :a => [ { :b => 1, :d => 3 } ], :a2 => true }, { :a => [ { :c => 2, :e => 4 } ] } ] end let(:output) do { :a => [ { :b => 1, :c => 2, :d => 3, :e => 4 } ], :a2 => true } end it "handles hashes with arrays" do result = JsonSchemaSpec::Util.deep_merge(input[0], input[1]) expect(result).to eq(output) end it "handles arrays with hashes" do result = JsonSchemaSpec::Util.deep_merge( [ input[0] ], [ input[1] ] ) expect(result).to eq([ output ]) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
json_schema_spec-0.0.8 | spec/json_schema_spec/util_spec.rb |
json_schema_spec-0.0.7 | spec/json_schema_spec/util_spec.rb |
json_schema_spec-0.0.6 | spec/json_schema_spec/util_spec.rb |