structure_compare 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f2e2820a623f8736e70f56a9be77e4058d2d92e
|
4
|
+
data.tar.gz: 45dc459fd60189528bdc3a101ba669040e905670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f79e4d739d1ac39ad71bae9d0cce84ec53c0ea26c2441221f5ecbfd5e1504ba52fbbbe090fcb3a46bd318da21748688a6d6d4ce0a8f0df8d32bf2a8fb6156251
|
7
|
+
data.tar.gz: d1d6c84c7a1f1a15ea54ec65ea66572d2897475ba0a6a93c33d217c0f68e24596a446aa6d8fe5a62c9a3678eb8dd731edadcf04756355cab3e348bed2eca7fe6
|
@@ -81,14 +81,16 @@ module StructureCompare
|
|
81
81
|
expected_keys = expected.keys
|
82
82
|
actual_keys = actual.keys
|
83
83
|
|
84
|
+
failure_message = "hash keys aren't equal. " \
|
85
|
+
"expected: #{expected_keys.map(&:to_s).join(',')}, " \
|
86
|
+
"actual: #{actual_keys.map(&:to_s).join(',')}"
|
87
|
+
|
84
88
|
if @options[:indifferent_access]
|
85
89
|
# NOTE: not all hash keys are symbols/strings, only convert symbols
|
86
90
|
expected_keys.map! { |key| key.is_a?(Symbol) ? key.to_s : key }
|
87
91
|
actual_keys.map! { |key| key.is_a?(Symbol) ? key.to_s : key }
|
88
92
|
end
|
89
93
|
|
90
|
-
failure_message = "hash keys aren't equal"
|
91
|
-
|
92
94
|
if @options[:strict_key_order]
|
93
95
|
if expected_keys != actual_keys
|
94
96
|
not_equal_error!(expected_keys, actual_keys, failure_message)
|