webmock-twirp 0.4.2 → 0.5.1

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
  SHA256:
3
- metadata.gz: 607a11741909a668d93abbf06cc7c1a63f2be283230c46f2bc9ca3fc230cb747
4
- data.tar.gz: 6ebdf1ef48c0886b5c0dda1db1bad290295b7efe52115a28dfaca66dec2ff1df
3
+ metadata.gz: e45e4abde5e884aac42e578b3ac9ffc45cad2538d395cb8fff7bb87c391ef6fe
4
+ data.tar.gz: a7acf241b5cd85879bb0afa3d60c1b25dcf7f416eff3c85b58ee87224de8395a
5
5
  SHA512:
6
- metadata.gz: a9166fa3477ecc944b0b726f7391307c9c75a5aa50a93ae20aa43f8a3d3af82bf536a4a9b949a7ae757ed27655a650b7b641d956a25ad6d3f5bd87516e478798
7
- data.tar.gz: c0c2eb90b95a0eb0039772fccc7053e9c19170e38c34f6d002c83edb779b544ef555b827d0c49e8f36b5c4df9ac4780db89540d8759c55e8de4534dc0d2b0295
6
+ metadata.gz: 57fb45deb5e5bb6d379ea3935edd84b4441561a856fea45d37bd6904953ba2a7a8fabe861bdd4d1b850c7d728d813afa018a4f9d0371581044b8a61ce5f870b0
7
+ data.tar.gz: facbf65f3132f690eaedebe6db9d9914182439e8519f16e5ee415fe06494e18bd8af6c675809753bbe223ca40b2b89f57fde680a47abdb34080c1d61b8c7fa95
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### v0.5.1 (2024-04-17)
2
+ - fix rpc name matching
3
+
4
+ ### v0.5.0 (2024-04-07)
5
+ - codecov upgrade
6
+ - drop ruby 2.7 (#65)
7
+
1
8
  ### v0.4.2 (2023-04-05)
2
9
  - ruby 2 compatibility
3
10
  - twirp 1.10 compatibility
data/Gemfile.lock CHANGED
@@ -1,46 +1,46 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webmock-twirp (0.4.2)
4
+ webmock-twirp (0.5.1)
5
5
  twirp (>= 1)
6
6
  webmock (>= 3)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.8.3)
11
+ addressable (2.8.6)
12
12
  public_suffix (>= 2.0.2, < 6.0)
13
+ base64 (0.2.0)
14
+ bigdecimal (3.1.6)
13
15
  byebug (11.1.3)
14
- codecov (0.2.12)
15
- json
16
- simplecov
17
- crack (0.4.5)
16
+ crack (1.0.0)
17
+ bigdecimal
18
18
  rexml
19
- diff-lcs (1.5.0)
19
+ diff-lcs (1.5.1)
20
20
  docile (1.4.0)
21
- faraday (2.7.4)
21
+ faraday (2.7.11)
22
+ base64
22
23
  faraday-net_http (>= 2.0, < 3.1)
23
24
  ruby2_keywords (>= 0.0.4)
24
25
  faraday-net_http (3.0.2)
25
- google-protobuf (3.22.2)
26
- hashdiff (1.0.1)
27
- json (2.6.3)
28
- public_suffix (5.0.1)
29
- rack (3.0.7)
30
- rexml (3.2.5)
31
- rspec (3.12.0)
32
- rspec-core (~> 3.12.0)
33
- rspec-expectations (~> 3.12.0)
34
- rspec-mocks (~> 3.12.0)
35
- rspec-core (3.12.0)
36
- rspec-support (~> 3.12.0)
37
- rspec-expectations (3.12.0)
26
+ google-protobuf (3.25.3)
27
+ hashdiff (1.1.0)
28
+ public_suffix (5.0.4)
29
+ rack (3.0.10)
30
+ rexml (3.2.6)
31
+ rspec (3.13.0)
32
+ rspec-core (~> 3.13.0)
33
+ rspec-expectations (~> 3.13.0)
34
+ rspec-mocks (~> 3.13.0)
35
+ rspec-core (3.13.0)
36
+ rspec-support (~> 3.13.0)
37
+ rspec-expectations (3.13.0)
38
38
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.12.0)
40
- rspec-mocks (3.12.1)
39
+ rspec-support (~> 3.13.0)
40
+ rspec-mocks (3.13.0)
41
41
  diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.12.0)
43
- rspec-support (3.12.0)
42
+ rspec-support (~> 3.13.0)
43
+ rspec-support (3.13.0)
44
44
  ruby2_keywords (0.0.5)
45
45
  simplecov (0.22.0)
46
46
  docile (~> 1.1)
@@ -51,7 +51,7 @@ GEM
51
51
  twirp (1.10.0)
52
52
  faraday (< 3)
53
53
  google-protobuf (~> 3.0, >= 3.7.0)
54
- webmock (3.18.1)
54
+ webmock (3.23.0)
55
55
  addressable (>= 2.8.0)
56
56
  crack (>= 0.3.2)
57
57
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -62,7 +62,6 @@ PLATFORMS
62
62
 
63
63
  DEPENDENCIES
64
64
  byebug
65
- codecov
66
65
  rack
67
66
  rspec
68
67
  simplecov
@@ -70,4 +69,4 @@ DEPENDENCIES
70
69
  webrick
71
70
 
72
71
  BUNDLED WITH
73
- 2.3.17
72
+ 2.4.20
data/README.md CHANGED
@@ -3,7 +3,7 @@ WebMock::Twirp
3
3
  ![Gem](https://img.shields.io/gem/dt/webmock-twirp?style=plastic)
4
4
  [![codecov](https://codecov.io/gh/dpep/webmock-twirp/branch/main/graph/badge.svg)](https://codecov.io/gh/dpep/webmock-twirp)
5
5
 
6
- Twirp support for [WebMock](https://github.com/bblimke/webmock). All our favorite http request stubbing for Twirp RPCs - message and error serialization done automatically.
6
+ Twirp support for [WebMock](https://github.com/bblimke/webmock). All our favorite http request stubbing for [Twirp](https://github.com/twitchtv/twirp) RPCs - message and error serialization done automatically.
7
7
 
8
8
  ### Install
9
9
  ```ruby
@@ -44,8 +44,6 @@ stub_twirp_request.and_return do |request|
44
44
  end
45
45
  ```
46
46
 
47
- For additional RSpec support, see [rspec-twirp](https://github.com/dpep/rspec-twirp).
48
-
49
47
 
50
48
  ## Usage
51
49
 
@@ -99,6 +97,16 @@ stub_twirp_request.to_return do |request|
99
97
  end
100
98
  ```
101
99
 
100
+ ## RSpec
101
+ ```ruby
102
+ stub = stub_twirp_request
103
+ # ... make requests ...
104
+ expect(stub).to have_been_requested
105
+ ```
106
+
107
+ For Twirp specific RSpec matchers, see [rspec-twirp](https://github.com/dpep/rspec-twirp)
108
+
109
+
102
110
  ## Improved WebMock Errors
103
111
  Before
104
112
  ```ruby
@@ -61,14 +61,7 @@ module WebMock
61
61
  # match rpc dynamically after client resolves
62
62
  @rpc_name = rpc_name
63
63
 
64
- @request_pattern.with do |request|
65
- rpc_info = request.twirp_rpc
66
-
67
- !!rpc_info && (
68
- rpc_info[:rpc_method] == rpc_name ||
69
- rpc_info[:ruby_method] == rpc_name
70
- )
71
- end
64
+ with
72
65
  end
73
66
  end
74
67
 
@@ -106,6 +99,16 @@ module WebMock
106
99
  request = request_signature.twirp_request
107
100
  matched &&= !!request
108
101
 
102
+ # match rpc_name
103
+ if @rpc_name
104
+ rpc_info = request_signature.twirp_rpc
105
+
106
+ matched &&= !!rpc_info && (
107
+ rpc_info[:rpc_method] == @rpc_name ||
108
+ rpc_info[:ruby_method] == @rpc_name
109
+ )
110
+ end
111
+
109
112
  # match request attributes
110
113
  if attrs.any?
111
114
  matched &&= request.include?(attrs)
@@ -1,5 +1,5 @@
1
1
  module WebMock
2
2
  module Twirp
3
- VERSION = "0.4.2"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
@@ -11,11 +11,12 @@ Gem::Specification.new do |s|
11
11
  s.summary = package.to_s
12
12
  s.version = package.const_get "VERSION"
13
13
 
14
+ s.required_ruby_version = ">= 3"
15
+
14
16
  s.add_dependency "webmock", ">= 3"
15
17
  s.add_dependency "twirp", ">= 1"
16
18
 
17
19
  s.add_development_dependency "byebug"
18
- s.add_development_dependency "codecov"
19
20
  s.add_development_dependency "rack"
20
21
  s.add_development_dependency "rspec"
21
22
  s.add_development_dependency "simplecov"
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.4.2
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-05 00:00:00.000000000 Z
11
+ date: 2024-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webmock
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: codecov
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rack
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -159,14 +145,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
145
  requirements:
160
146
  - - ">="
161
147
  - !ruby/object:Gem::Version
162
- version: '0'
148
+ version: '3'
163
149
  required_rubygems_version: !ruby/object:Gem::Requirement
164
150
  requirements:
165
151
  - - ">="
166
152
  - !ruby/object:Gem::Version
167
153
  version: '0'
168
154
  requirements: []
169
- rubygems_version: 3.3.7
155
+ rubygems_version: 3.3.26
170
156
  signing_key:
171
157
  specification_version: 4
172
158
  summary: WebMock::Twirp