rspec-json_matcher 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b5b194d82e6f879060a40c9cee4ecdd96cd38ab
4
- data.tar.gz: d7e4b9e053a6a0312542f451a9d6be0183cf469f
3
+ metadata.gz: 9b01935d9caff916affc9015bb7210a04314b351
4
+ data.tar.gz: f781b67128b9852ca4d5adbd4a603c07cc324568
5
5
  SHA512:
6
- metadata.gz: 419d26029dab6cf9868443c61fe14ddfedbd35cc6a1403b2760b03c0a04771ab202ef868c237311a2edeee08030d78c60a7bc1e5d569f10ccf6ef10ec6f22f3a
7
- data.tar.gz: 8434fa25f560b14afc212606c994969fefb18368695c9fc5844b96cc18f93faa91e12a547c8a97622ef059dc1f3e18b575ca6a0a54f94f46e0f2e3f33bff87f4
6
+ metadata.gz: 4981405b7a1833d0255d79b67aebea2cb05051f682f13492546905c766424528b35b5cd7a7770fcfa67e189f32587f5060cb276cb6215ae860e8892bdaa328df
7
+ data.tar.gz: 3b073a2a714d677a3f787de3d77fefcd946511503f2b68ed8f359dfb3088ad440a5bad6e7e2496ba7875b88a6f524c33986a356cb9371a1f55b435c5d3ddd8f7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.0.6
2
+ * Fix a bug in comparison with Hash keys
3
+
1
4
  ## 0.0.5
2
5
  * More strict comparison to detect different Hash keys
3
6
 
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module JsonMatcher
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -93,7 +93,7 @@ module RSpec
93
93
  end
94
94
 
95
95
  def has_same_keys?
96
- (self.class.extract_keys(actual) - self.class.extract_keys(expected)).size == 0
96
+ self.class.extract_keys(actual).sort == self.class.extract_keys(expected).sort
97
97
  end
98
98
 
99
99
  def has_same_value?
@@ -17,6 +17,17 @@ describe RSpec::JsonMatcher do
17
17
  end
18
18
  end
19
19
 
20
+ context "with non-existent keys in JSON" do
21
+ it "does not match" do
22
+ {
23
+ "a" => nil,
24
+ }.to_json.should_not be_json(
25
+ "a" => nil,
26
+ "b" => nil,
27
+ )
28
+ end
29
+ end
30
+
20
31
  context "with valid JSON" do
21
32
  it "matches with handy patterns" do
22
33
  [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-json_matcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-25 00:00:00.000000000 Z
11
+ date: 2013-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json