json_expressions 0.8.3 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +7 -7
- data/lib/json_expressions/matcher.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bac6dbc750fd14835c229c59f74a73ec1c6ff911
|
4
|
+
data.tar.gz: 256d95feb9c16c2cd88d0eb34334fbd633381d37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad4148de4d82bdaa27772c16576e007ec1a854f9be53afa8ca5a40b4f9658d66115ea508969ccd5cddd8b5c44ed7444d3b1fad8478ecf09c1565e86980f94678
|
7
|
+
data.tar.gz: bacd6ff650194838845b9ba7e9b9bbaa97678fb4b992277bce537b54e70227c1bf90b0e1b5931fc2466455c9edee9cdbbf43a521d44d3be58733c627cc1c2f41
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
### v0.9.0 [view commit logs](https://github.com/chancancode/json_expressions/compare/0.8.3...0.9.0)
|
2
|
+
|
3
|
+
* Support for unified Integer class in Ruby 2.4+ (#39 from @iamliamnorton)
|
4
|
+
|
1
5
|
### v0.8.3 [view commit logs](https://github.com/chancancode/json_expressions/compare/0.8.2...0.8.3)
|
2
6
|
|
3
7
|
* Print more detailed error message when matching arrays (#26 from @Maxim-Filimonov)
|
data/README.md
CHANGED
@@ -22,19 +22,19 @@ class UsersControllerTest < MiniTest::Unit::TestCase
|
|
22
22
|
assert_equal 'Godfrey Chan', user['full_name']
|
23
23
|
assert_equal 'godfrey@example.com', user['email']
|
24
24
|
assert_equal 'Administrator', user['type']
|
25
|
-
assert_kind_of
|
25
|
+
assert_kind_of Integer, user['points']
|
26
26
|
assert_match /\Ahttps?\:\/\/.*\z/i, user['homepage']
|
27
27
|
|
28
28
|
assert posts = user['posts']
|
29
29
|
|
30
|
-
assert_kind_of
|
30
|
+
assert_kind_of Integer, posts[0]['id']
|
31
31
|
assert_equal 'Hello world!', posts[0]['subject']
|
32
32
|
assert_equal user_id, posts[0]['user_id']
|
33
33
|
assert_include posts[0]['tags'], 'announcement'
|
34
34
|
assert_include posts[0]['tags'], 'welcome'
|
35
35
|
assert_include posts[0]['tags'], 'introduction'
|
36
36
|
|
37
|
-
assert_kind_of
|
37
|
+
assert_kind_of Integer, posts[1]['id']
|
38
38
|
assert_equal 'An awesome blog post', posts[1]['subject']
|
39
39
|
assert_equal user_id, posts[1]['user_id']
|
40
40
|
assert_include posts[0]['tags'], 'blog'
|
@@ -89,13 +89,13 @@ class UsersControllerTest < MiniTest::Unit::TestCase
|
|
89
89
|
full_name: 'Godfrey Chan',
|
90
90
|
email: 'godfrey@example.com',
|
91
91
|
type: 'Administrator',
|
92
|
-
points:
|
92
|
+
points: Integer, # Any integer value
|
93
93
|
homepage: /\Ahttps?\:\/\/.*\z/i, # Let's get serious
|
94
94
|
created_at: wildcard_matcher, # Don't care as long as it exists
|
95
95
|
updated_at: wildcard_matcher,
|
96
96
|
posts: [
|
97
97
|
{
|
98
|
-
id:
|
98
|
+
id: Integer,
|
99
99
|
subject: 'Hello world!',
|
100
100
|
user_id: :user_id, # Match against the captured value
|
101
101
|
tags: [
|
@@ -105,7 +105,7 @@ class UsersControllerTest < MiniTest::Unit::TestCase
|
|
105
105
|
] # Ordering of elements does not matter by default
|
106
106
|
}.ignore_extra_keys!, # Skip the uninteresting stuff
|
107
107
|
{
|
108
|
-
id:
|
108
|
+
id: Integer,
|
109
109
|
subject: 'An awesome blog post',
|
110
110
|
user_id: :user_id,
|
111
111
|
tags: ['blog' , 'life']
|
@@ -226,7 +226,7 @@ but not
|
|
226
226
|
`Module` (and by inheritance, `Class`) overrides `===` to mean `instance of`. You can exploit this behavior to do type matching:
|
227
227
|
```ruby
|
228
228
|
{
|
229
|
-
integer:
|
229
|
+
integer: Integer,
|
230
230
|
float: Float,
|
231
231
|
string: String,
|
232
232
|
boolean: Boolean, # See http://stackoverflow.com/questions/3028243/check-if-ruby-object-is-a-boolean#answer-3028378
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_expressions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Godfrey Chan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: JSON matchmaking for all your API testing needs.
|
14
14
|
email:
|
@@ -39,17 +39,17 @@ require_paths:
|
|
39
39
|
- lib
|
40
40
|
required_ruby_version: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0'
|
45
45
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: 1.3.6
|
50
50
|
requirements: []
|
51
51
|
rubyforge_project:
|
52
|
-
rubygems_version: 2.
|
52
|
+
rubygems_version: 2.6.10
|
53
53
|
signing_key:
|
54
54
|
specification_version: 4
|
55
55
|
summary: JSON Expressions
|