webmock-twirp 0.4.1 → 0.5.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 +8 -0
- data/Gemfile.lock +33 -52
- data/README.md +11 -1
- data/lib/webmock/twirp/request_stub.rb +6 -0
- data/lib/webmock/twirp/version.rb +1 -1
- data/webmock-twirp.gemspec +2 -1
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbad5503c5dd1bde8669aecc1119f73c79b709ac1cb6075c664866ecd9d2f27c
|
4
|
+
data.tar.gz: 7c3ee3cb14d758a6d4a75abefd6d4a87301a2176baa351f78339532252944f2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f185ac5c5a58f9188770b0ac787ef5d11c1a1d665b1f8cc1e33befcd27399b60adc645df990caa2368fbd354eec224397f63f06c1154d3039db487cc555193ea
|
7
|
+
data.tar.gz: d24dd405de783c33a2a7c5aba2fe27a8208bccd1b613c91cb75618103a54437e1e88bdb609efaddfe89ebdb0b197c876bb305c8475f753c925e010ca35c5c35a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,86 +1,67 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
webmock-twirp (0.
|
4
|
+
webmock-twirp (0.5.0)
|
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.
|
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
|
-
|
15
|
-
|
16
|
-
crack (0.4.5)
|
16
|
+
crack (1.0.0)
|
17
|
+
bigdecimal
|
17
18
|
rexml
|
18
|
-
diff-lcs (1.5.
|
19
|
+
diff-lcs (1.5.1)
|
19
20
|
docile (1.4.0)
|
20
|
-
faraday (
|
21
|
-
|
22
|
-
faraday-
|
23
|
-
faraday-excon (~> 1.1)
|
24
|
-
faraday-httpclient (~> 1.0)
|
25
|
-
faraday-multipart (~> 1.0)
|
26
|
-
faraday-net_http (~> 1.0)
|
27
|
-
faraday-net_http_persistent (~> 1.0)
|
28
|
-
faraday-patron (~> 1.0)
|
29
|
-
faraday-rack (~> 1.0)
|
30
|
-
faraday-retry (~> 1.0)
|
21
|
+
faraday (2.7.11)
|
22
|
+
base64
|
23
|
+
faraday-net_http (>= 2.0, < 3.1)
|
31
24
|
ruby2_keywords (>= 0.0.4)
|
32
|
-
faraday-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
multipart-post (2.2.3)
|
46
|
-
public_suffix (5.0.1)
|
47
|
-
rack (3.0.2)
|
48
|
-
rexml (3.2.5)
|
49
|
-
rspec (3.12.0)
|
50
|
-
rspec-core (~> 3.12.0)
|
51
|
-
rspec-expectations (~> 3.12.0)
|
52
|
-
rspec-mocks (~> 3.12.0)
|
53
|
-
rspec-core (3.12.0)
|
54
|
-
rspec-support (~> 3.12.0)
|
55
|
-
rspec-expectations (3.12.0)
|
25
|
+
faraday-net_http (3.0.2)
|
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)
|
56
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
-
rspec-support (~> 3.
|
58
|
-
rspec-mocks (3.
|
39
|
+
rspec-support (~> 3.13.0)
|
40
|
+
rspec-mocks (3.13.0)
|
59
41
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
-
rspec-support (~> 3.
|
61
|
-
rspec-support (3.
|
42
|
+
rspec-support (~> 3.13.0)
|
43
|
+
rspec-support (3.13.0)
|
62
44
|
ruby2_keywords (0.0.5)
|
63
|
-
simplecov (0.
|
45
|
+
simplecov (0.22.0)
|
64
46
|
docile (~> 1.1)
|
65
47
|
simplecov-html (~> 0.11)
|
66
48
|
simplecov_json_formatter (~> 0.1)
|
67
49
|
simplecov-html (0.12.3)
|
68
50
|
simplecov_json_formatter (0.1.4)
|
69
|
-
twirp (1.
|
70
|
-
faraday (<
|
51
|
+
twirp (1.10.0)
|
52
|
+
faraday (< 3)
|
71
53
|
google-protobuf (~> 3.0, >= 3.7.0)
|
72
|
-
webmock (3.
|
54
|
+
webmock (3.23.0)
|
73
55
|
addressable (>= 2.8.0)
|
74
56
|
crack (>= 0.3.2)
|
75
57
|
hashdiff (>= 0.4.0, < 2.0.0)
|
76
|
-
webrick (1.
|
58
|
+
webrick (1.8.1)
|
77
59
|
|
78
60
|
PLATFORMS
|
79
61
|
ruby
|
80
62
|
|
81
63
|
DEPENDENCIES
|
82
64
|
byebug
|
83
|
-
codecov
|
84
65
|
rack
|
85
66
|
rspec
|
86
67
|
simplecov
|
@@ -88,4 +69,4 @@ DEPENDENCIES
|
|
88
69
|
webrick
|
89
70
|
|
90
71
|
BUNDLED WITH
|
91
|
-
2.
|
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
|
@@ -97,6 +97,16 @@ stub_twirp_request.to_return do |request|
|
|
97
97
|
end
|
98
98
|
```
|
99
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
|
+
|
100
110
|
## Improved WebMock Errors
|
101
111
|
Before
|
102
112
|
```ruby
|
@@ -77,6 +77,12 @@ module WebMock
|
|
77
77
|
raise ArgumentError, "specify request or attrs, but not both"
|
78
78
|
end
|
79
79
|
|
80
|
+
# support Ruby 2 style attributes-as-hash instead of kwargs
|
81
|
+
if request.is_a?(Hash)
|
82
|
+
attrs = request
|
83
|
+
request = nil
|
84
|
+
end
|
85
|
+
|
80
86
|
request_matcher = if request
|
81
87
|
unless request.is_a?(Google::Protobuf::MessageExts)
|
82
88
|
raise TypeError, "Expected request to be Protobuf::MessageExts, found: #{request}"
|
data/webmock-twirp.gemspec
CHANGED
@@ -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
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Pepper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-07 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: '
|
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.
|
155
|
+
rubygems_version: 3.5.7
|
170
156
|
signing_key:
|
171
157
|
specification_version: 4
|
172
158
|
summary: WebMock::Twirp
|