rspec-json_matcher 0.1.1 → 0.1.2

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: 6977233f13aebf212773604c8fdb534684a94698
4
- data.tar.gz: 2d67300d1c469979c8bfbcb98d7713d00a425110
3
+ metadata.gz: 2f0ad49fcdce9262e3cf427f4b6b9f4ce9edae45
4
+ data.tar.gz: a97a62a5aa6d4fb1faa9b3ff7cc22b6e9b146017
5
5
  SHA512:
6
- metadata.gz: 0183fc2300e3b54c7888c484a5728ccee5e8fe147d86d770cd7b9651e8469a2f39b195c872fe3377b5bcbef1aba3c1105ec890100e450e366bc4731b9bcac25e
7
- data.tar.gz: 354002a26d9917027e8f7768cbe040aea3178477e496be8545c4dec42748066a7b0ff9e2c22c686ecfd9f64c33fe1d8c0ff13236c3c43f0d7da6bb8d8c6878c5
6
+ metadata.gz: 9525e34566d425c926be641e5e24a10d96adc4f089ff08affe090a967b52aa81b637ad8c6c29a9104ccb73c013fa21d7c8b0cd5052c432b343b0ad25cc3f6a19
7
+ data.tar.gz: d4dacfb46db4c153b02782a5aaca22debe27372e1b3adec8cd435000726d52137c2460a09655da69418f375b98776f184ab4862beabfb451e2e39521ee40f757
@@ -1,3 +1,6 @@
1
+ ## 0.1.2
2
+ * Convert keys in expectation from Symbol to String
3
+
1
4
  ## 0.1.1
2
5
  * Suppress deprecation warnings for RSpec 3
3
6
 
@@ -11,7 +11,7 @@ module RSpec
11
11
  if array_or_hash.is_a?(Array)
12
12
  array_or_hash.each_index.to_a
13
13
  else
14
- array_or_hash.keys
14
+ array_or_hash.keys.map(&:to_s)
15
15
  end
16
16
  end
17
17
 
@@ -53,7 +53,7 @@ module RSpec
53
53
  end
54
54
  else
55
55
  expected.keys.all? do |key|
56
- actual.has_key?(key) && self.class.compare(actual[key], expected[key])
56
+ actual.has_key?(key.to_s) && self.class.compare(actual[key.to_s], expected[key])
57
57
  end
58
58
  end
59
59
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module JsonMatcher
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -168,6 +168,12 @@ describe RSpec::JsonMatcher do
168
168
  ])
169
169
  end
170
170
  end
171
+
172
+ context "with symbol keys expectation" do
173
+ it "matches" do
174
+ { "foo" => "bar" }.to_json.should be_json_as(foo: "bar")
175
+ end
176
+ end
171
177
  end
172
178
 
173
179
  describe "#be_json_including" do
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.1.1
4
+ version: 0.1.2
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-12-16 00:00:00.000000000 Z
11
+ date: 2013-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -132,4 +132,3 @@ summary: RSpec matcher for testing JSON string
132
132
  test_files:
133
133
  - spec/rspec/json_matcher_spec.rb
134
134
  - spec/spec_helper.rb
135
- has_rdoc: