rspec-resembles_json_matchers 0.7.2 → 0.7.3
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 +4 -4
- data/Changelog.md +5 -0
- data/lib/rspec/resembles_json_matchers/attribute_differ.rb +8 -0
- data/lib/rspec/resembles_json_matchers/attribute_matcher.rb +1 -1
- data/lib/rspec/resembles_json_matchers/json_matcher.rb +2 -2
- data/lib/rspec/resembles_json_matchers/resembles_boolean_matcher.rb +2 -0
- data/lib/rspec/resembles_json_matchers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc45f9e78cd12d10e4fc69f32ec8d769457c8d4faff0a494dd9b0d10f1e00ca5
|
4
|
+
data.tar.gz: 8b71e34ddb22051a25b6718160d915821cc2c69e4c918b25cb55bd8041d7a59f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c10591785aba3c745864adb9ff7d07c809067ec2b5463a4b93337dcd0fe1799affb03ab4f82cfdafac57466d0d0558a1202d2d83fa30b34ea66e6ed392ef8e6c
|
7
|
+
data.tar.gz: 855818de72c091fe87624b93fb1600b78a585eff0a1474415ba81e7ad8496f4a33676b5f3dde0da04b313c72cf070151f7789e4e208209e9a78410a4bd350594
|
data/Changelog.md
CHANGED
@@ -107,6 +107,10 @@ module RSpec::ResemblesJsonMatchers
|
|
107
107
|
@buffer.print prefix + "]"
|
108
108
|
end
|
109
109
|
|
110
|
+
def render_ResemblesBooleanMatcher(matcher, **opts)
|
111
|
+
@buffer.print matcher.expected.to_json
|
112
|
+
end
|
113
|
+
|
110
114
|
def render_ResemblesStringMatcher(matcher, **opts)
|
111
115
|
@buffer.print matcher.expected.to_json
|
112
116
|
end
|
@@ -127,6 +131,10 @@ module RSpec::ResemblesJsonMatchers
|
|
127
131
|
@buffer.print "null"
|
128
132
|
end
|
129
133
|
|
134
|
+
def render_ResemblesRouteMatcher(matcher, **opts)
|
135
|
+
@buffer.print matcher.expected.inspect
|
136
|
+
end
|
137
|
+
|
130
138
|
def method_missing(method_name, *args, &block)
|
131
139
|
if method_name.to_s.start_with?("render_")
|
132
140
|
raise NoMethodError, method_name if method_name.to_s.end_with?("Matcher")
|
@@ -15,11 +15,11 @@ module RSpec::ResemblesJsonMatchers
|
|
15
15
|
attr_reader :expected, :actual
|
16
16
|
|
17
17
|
def initialize(expected_json)
|
18
|
-
@expected = expected_json.deep_stringify_keys
|
18
|
+
@expected = expected_json.try(:deep_stringify_keys)
|
19
19
|
end
|
20
20
|
|
21
21
|
def matches?(actual_json)
|
22
|
-
@actual = actual_json.deep_stringify_keys
|
22
|
+
@actual = actual_json.try(:deep_stringify_keys)
|
23
23
|
all_passed = true
|
24
24
|
expected_matchers.each do |key, attr_matcher|
|
25
25
|
result = attr_matcher.matches?(actual)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-resembles_json_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Sadauskas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|