rspec-json_matcher 0.1.5 → 0.1.6

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: 5f505a037e0c0116b2d25d3fddb4e3f0b1e670c2
4
- data.tar.gz: 83051af724876596f2fb4073f256c0b1bf66c8fc
3
+ metadata.gz: 7f5f066952486693dbd1db90c6463f3cd9b51f67
4
+ data.tar.gz: 2e828142a9fae863d0c14d1007ee629d4c089a80
5
5
  SHA512:
6
- metadata.gz: 1f55d366344aa0a69c356417bf155aa2b9af6eb9b07b0f4602f8f65116f6ea4feaa69fd8c86e401236d6f3c32a2e068ed584ce8fd17b69323338cdc9702c5ed7
7
- data.tar.gz: 81abea6d7b76bb531e16139e4a2c3fee26d290f278b2c65cd9bcf99cdd0bcf6bb415de5fc5d139afd74d6e95f2355d907a67f8e96dc70f4cfffb3018ceccd6fa
6
+ metadata.gz: 09a204ff069d6848a9830618e62d13b25e56e61f08d68e7d9a5b799cb57a8349f24524528c5f22c5671a2af2b377843c7e9540f251e9259fcbb8a8b2870b265f
7
+ data.tar.gz: 508f430ff863c0e4cd4e880300d6320561e868d25dc1e8ec91a26fd160abd88395ba71d107d0560c5bd48d6eb107dca72680564b5af07eb904bc76ea97e64e22
data/CHANGELOG.md CHANGED
@@ -1,38 +1,55 @@
1
- ## 0.1.5
2
- * Show reasons in failure case
1
+ ## v0.1.6
3
2
 
4
- ## 0.1.4
5
- * Support RSpec 3 style negative failure message
3
+ - Support composable matchers and matching arguments usecase
6
4
 
7
- ## 0.1.3
8
- * Fix method name for negative case
5
+ ## v0.1.5
9
6
 
10
- ## 0.1.2
11
- * Convert keys in expectation from Symbol to String
7
+ - Show reasons in failure case
12
8
 
13
- ## 0.1.2
14
- * Convert keys in expectation from Symbol to String
9
+ ## v0.1.4
15
10
 
16
- ## 0.1.1
17
- * Suppress deprecation warnings for RSpec 3
11
+ - Support RSpec 3 style negative failure message
18
12
 
19
- ## 0.1.0
20
- * Change interface to be_json_including & be_json_as matchers
13
+ ## v0.1.3
21
14
 
22
- ## 0.0.6
23
- * Fix a bug in comparison with Hash keys
15
+ - Fix method name for negative case
24
16
 
25
- ## 0.0.5
26
- * More strict comparison to detect different Hash keys
17
+ ## v0.1.2
27
18
 
28
- ## 0.0.4
29
- * Change indent style on failure message
19
+ - Convert keys in expectation from Symbol to String
30
20
 
31
- ## 0.0.3
32
- * Bundler friendliness
21
+ ## v0.1.2
33
22
 
34
- ## 0.0.2
35
- * Tiny refactoring
23
+ - Convert keys in expectation from Symbol to String
36
24
 
37
- ## 0.0.1
38
- * The first release on 2013-4-25
25
+ ## v0.1.1
26
+
27
+ - Suppress deprecation warnings for RSpec 3
28
+
29
+ ## v0.1.0
30
+
31
+ - Change interface to be_json_including & be_json_as matchers
32
+
33
+ ## v0.0.6
34
+
35
+ - Fix a bug in comparison with Hash keys
36
+
37
+ ## v0.0.5
38
+
39
+ - More strict comparison to detect different Hash keys
40
+
41
+ ## v0.0.4
42
+
43
+ - Change indent style on failure message
44
+
45
+ ## v0.0.3
46
+
47
+ - Bundler friendliness
48
+
49
+ ## v0.0.2
50
+
51
+ - Tiny refactoring
52
+
53
+ ## v0.0.1
54
+
55
+ - The first release on 2013-4-25
@@ -22,6 +22,8 @@ module RSpec
22
22
  false
23
23
  end
24
24
 
25
+ alias_method :===, :matches?
26
+
25
27
  def compare(&reason)
26
28
  raise NotImplementedError, "You must implement #{self.class}#compare"
27
29
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module JsonMatcher
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
@@ -13,6 +13,14 @@ describe RSpec::JsonMatcher do
13
13
  {}.to_json.should be_json
14
14
  end
15
15
  end
16
+
17
+ context 'when used with a composable matcher' do
18
+ it 'matches' do
19
+ {
20
+ "a" => {"b" => 1}.to_json
21
+ }.should match("a" => be_json)
22
+ end
23
+ end
16
24
  end
17
25
 
18
26
  describe "#be_json_as" do
@@ -174,6 +182,14 @@ describe RSpec::JsonMatcher do
174
182
  { "foo" => "bar" }.to_json.should be_json_as(foo: "bar")
175
183
  end
176
184
  end
185
+
186
+ context 'when used with a composable matcher' do
187
+ it 'matches' do
188
+ {
189
+ "a" => {"b" => 1}.to_json
190
+ }.should match("a" => be_json_as("b" => 1))
191
+ end
192
+ end
177
193
  end
178
194
 
179
195
  describe "#be_json_including" do
@@ -293,5 +309,13 @@ describe RSpec::JsonMatcher do
293
309
  )
294
310
  end
295
311
  end
312
+
313
+ context 'when used with a composable matcher' do
314
+ it 'matches' do
315
+ {
316
+ "a" => {"b" => 1, "c" => 2}.to_json
317
+ }.should match("a" => be_json_including("b" => 1))
318
+ end
319
+ end
296
320
  end
297
321
  end
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.5
4
+ version: 0.1.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: 2014-07-11 00:00:00.000000000 Z
11
+ date: 2016-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -125,11 +125,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.2.2
128
+ rubygems_version: 2.4.5.1
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  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: