json_schema_spec 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/json_schema_spec.gemspec +1 -1
- data/lib/json_schema_spec/util.rb +5 -1
- data/spec/json_schema_spec/util_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa6cb1f2bc26111b92f3ad0f69607355098ce2b1
|
4
|
+
data.tar.gz: 7ab3aa8ad52d3b24688e9bec601084054bc0dc2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 839992a15fb2060fc7e21833baf9fb0b7cb0bd73cd571c70371bba5d25af025761ff96719cc335a13fea0c0164d620e1410f6cdac33b6967531a589acb77ac10
|
7
|
+
data.tar.gz: c4755baa8fa4778ef7e9ac11b7240d9c2663f1cf6aa9f3c6bd914fa70f4e4c94f71268452e10b9fd100cf376f7e5d819946cb0ba0bfcc942337be29dd7d439f9
|
data/json_schema_spec.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "json_schema_spec"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.9"
|
8
8
|
spec.authors = ["Winton Welsh"]
|
9
9
|
spec.email = ["mail@wintoni.us"]
|
10
10
|
spec.description = %q{Generate fixtures from JSON schemas.}
|
@@ -13,7 +13,11 @@ module JsonSchemaSpec
|
|
13
13
|
def deep_merge(value, other_value)
|
14
14
|
if value.is_a?(Hash) && other_value.is_a?(Hash)
|
15
15
|
other_value.each_pair do |k, v|
|
16
|
-
|
16
|
+
if v == :_DEL
|
17
|
+
value.delete(k)
|
18
|
+
else
|
19
|
+
value[k] = deep_merge(value[k], v)
|
20
|
+
end
|
17
21
|
end
|
18
22
|
|
19
23
|
elsif value.is_a?(Array) && other_value.is_a?(Array)
|
@@ -5,8 +5,8 @@ describe JsonSchemaSpec::Util do
|
|
5
5
|
|
6
6
|
let(:input) do
|
7
7
|
[
|
8
|
-
{ :a => [ { :b => 1, :d => 3 } ], :a2 => true },
|
9
|
-
{ :a => [ { :c => 2, :e => 4 } ] }
|
8
|
+
{ :a => [ { :b => 1, :d => 3, :f => 5 } ], :a2 => true },
|
9
|
+
{ :a => [ { :c => 2, :e => 4, :f => :_DEL } ] }
|
10
10
|
]
|
11
11
|
end
|
12
12
|
|