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 +4 -4
- data/CHANGELOG.md +43 -26
- data/lib/rspec/json_matcher/abstract_matcher.rb +2 -0
- data/lib/rspec/json_matcher/version.rb +1 -1
- data/spec/rspec/json_matcher_spec.rb +24 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f5f066952486693dbd1db90c6463f3cd9b51f67
|
4
|
+
data.tar.gz: 2e828142a9fae863d0c14d1007ee629d4c089a80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09a204ff069d6848a9830618e62d13b25e56e61f08d68e7d9a5b799cb57a8349f24524528c5f22c5671a2af2b377843c7e9540f251e9259fcbb8a8b2870b265f
|
7
|
+
data.tar.gz: 508f430ff863c0e4cd4e880300d6320561e868d25dc1e8ec91a26fd160abd88395ba71d107d0560c5bd48d6eb107dca72680564b5af07eb904bc76ea97e64e22
|
data/CHANGELOG.md
CHANGED
@@ -1,38 +1,55 @@
|
|
1
|
-
##
|
2
|
-
* Show reasons in failure case
|
1
|
+
## v0.1.6
|
3
2
|
|
4
|
-
|
5
|
-
* Support RSpec 3 style negative failure message
|
3
|
+
- Support composable matchers and matching arguments usecase
|
6
4
|
|
7
|
-
##
|
8
|
-
* Fix method name for negative case
|
5
|
+
## v0.1.5
|
9
6
|
|
10
|
-
|
11
|
-
* Convert keys in expectation from Symbol to String
|
7
|
+
- Show reasons in failure case
|
12
8
|
|
13
|
-
##
|
14
|
-
* Convert keys in expectation from Symbol to String
|
9
|
+
## v0.1.4
|
15
10
|
|
16
|
-
|
17
|
-
* Suppress deprecation warnings for RSpec 3
|
11
|
+
- Support RSpec 3 style negative failure message
|
18
12
|
|
19
|
-
##
|
20
|
-
* Change interface to be_json_including & be_json_as matchers
|
13
|
+
## v0.1.3
|
21
14
|
|
22
|
-
|
23
|
-
* Fix a bug in comparison with Hash keys
|
15
|
+
- Fix method name for negative case
|
24
16
|
|
25
|
-
##
|
26
|
-
* More strict comparison to detect different Hash keys
|
17
|
+
## v0.1.2
|
27
18
|
|
28
|
-
|
29
|
-
* Change indent style on failure message
|
19
|
+
- Convert keys in expectation from Symbol to String
|
30
20
|
|
31
|
-
##
|
32
|
-
* Bundler friendliness
|
21
|
+
## v0.1.2
|
33
22
|
|
34
|
-
|
35
|
-
* Tiny refactoring
|
23
|
+
- Convert keys in expectation from Symbol to String
|
36
24
|
|
37
|
-
##
|
38
|
-
|
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
|
@@ -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.
|
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:
|
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.
|
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:
|