wildcard_matchers 0.3.0 → 0.3.1

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: 68dd29b55f94a55eda5bb24f053ea9f42c6701e4
4
- data.tar.gz: 382aabd7935d156693a70bb9c0b695e4bd90a1b7
3
+ metadata.gz: 9f0029733e952a19949334e821540bcd02666e63
4
+ data.tar.gz: 8129970e9554d6d724891529d1dda6712fe2bfa1
5
5
  SHA512:
6
- metadata.gz: 4ad2caeaf6898e7770b0364e36c2657961f4fa50e9bd76f2fc50c5a761245076aec7c897778aa3439ff3dd3c6225e84c8c5986cb81a81733468dcd83d3e4afd6
7
- data.tar.gz: 9895719d8c2bcbb43869b6043a0c84e61146fca6a4c0fb3e7b26fbf87d59c180446c6de2846c67ab62f4ed33dcaffb12b3d1d27e5e6c372e25e38d18dd953821
6
+ metadata.gz: d35e104eef286b82162eb6363d38b3f91512ca504a44fecb712967a1b53d70d02d3333df3362e920f3f0841e85992610446d89c8e90dcc5548d36742a8f43766
7
+ data.tar.gz: 0ed3f3e94e1ca35ba7087c3f06e8ecb56f29a19ccfb6c3de31b0b2b6e4d447f592fc43514d31a6dc0e62b697f5b526bc742216adc2fe959241f44bac6d1dd3c9
@@ -1,3 +1,8 @@
1
+ ## 0.3.1
2
+
3
+ * IMPROVEMENT
4
+ * improve error message when hash keys mismatch
5
+
1
6
  ## 0.3.0
2
7
  * ENHANCEMENT
3
8
  * allow method object
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -99,8 +99,18 @@ module WildcardMatchers
99
99
  errors.push(*self.class.superclass.check_errors(actual[key], value, position + "[#{key.inspect}]"))
100
100
  end
101
101
  else
102
- errors << "#{position}: expect Hash keys #{actual.keys} to #{expectation.keys}"
103
- #TODO: diff-lcs
102
+ begin
103
+ actual_keys = actual.keys.sort
104
+ expected_keys = expectation.keys.sort
105
+
106
+ extra = actual_keys - expected_keys
107
+ short = expected_keys - actual_keys
108
+
109
+ errors << "#{position}: expect Hash keys #{actual_keys} to #{expected_keys}\n extra: #{extra}\n short: #{short}"
110
+ rescue
111
+ # when keys has more patterns than expacted
112
+ errors << "#{position}: expect Hash keys #{actual.keys} to #{expectation.keys}"
113
+ end
104
114
  end
105
115
  end
106
116
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wildcard_matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - okitan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-23 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facets