webmock-twirp 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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/webmock/twirp/refinements.rb +9 -0
- data/lib/webmock/twirp/request_stub.rb +10 -3
- data/lib/webmock/twirp/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: 0264d26c4984559b4163ff5740fda0df43882736fa174881a63939c195e85331
|
4
|
+
data.tar.gz: 9d0da633242e3f722d18c0c97042c5312b16ba4fb28fb6509479a04f5c4201eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 369e27e257599a09541feb244e9a4c1ff59a7b069c3df154c361c6567ce8f15f0e3b46cbfb0252ebe7c72beed20cb31bb8c947857d84372aec7ae3d697e21602
|
7
|
+
data.tar.gz: 7aa1544321a07d5f8350203f16f331d2e9ee90b5b38928d29d1b4fb2750101109298796ff7b571684108af8aaf3c80d4b2d595a27cdef0b33715c888cb99f1cd
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,15 @@ module WebMock
|
|
6
6
|
find(&block)&.tap { |x| delete(x) }
|
7
7
|
end
|
8
8
|
end
|
9
|
+
|
10
|
+
refine Google::Protobuf::MessageExts do
|
11
|
+
def normalized_hash(symbolize_keys: true)
|
12
|
+
JSON.parse(
|
13
|
+
to_json(preserve_proto_fieldnames: true),
|
14
|
+
symbolize_names: symbolize_keys,
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
9
18
|
end
|
10
19
|
end
|
11
20
|
end
|
@@ -76,10 +76,17 @@ module WebMock
|
|
76
76
|
decoded_request = input_class.decode(request.body)
|
77
77
|
|
78
78
|
if attrs.any?
|
79
|
-
|
80
|
-
|
79
|
+
if defined?(RSpec::Matchers::BuiltIn::Include)
|
80
|
+
matcher = RSpec::Matchers::BuiltIn::Include.new(attrs)
|
81
|
+
attr_hash = decoded_request.to_h
|
82
|
+
normalize = ->{ decoded_request.normalized_hash }
|
83
|
+
else
|
84
|
+
matcher = WebMock::Matchers::HashIncludingMatcher.new(attrs)
|
85
|
+
attr_hash = WebMock::Util::HashKeysStringifier.stringify_keys!(decoded_request.to_h, deep: true)
|
86
|
+
normalize = ->{ decoded_request.normalized_hash(symbolize_keys: false) }
|
87
|
+
end
|
81
88
|
|
82
|
-
matched &=
|
89
|
+
matched &= (matcher === attr_hash || matcher === normalize.call)
|
83
90
|
end
|
84
91
|
|
85
92
|
if block
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmock-twirp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Pepper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: webmock
|