Skip to content

Commit f53ae77

Browse files
authored
Add test matrix and update dependencies (#52)
1 parent fe4dd92 commit f53ae77

File tree

7 files changed

+86
-80
lines changed

7 files changed

+86
-80
lines changed

.github/workflows/rubocop.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ jobs:
44
lint:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v3
88
- name: Set up Ruby
99
uses: ruby/setup-ruby@v1
1010
with:
11-
ruby-version: 3.1.1
11+
ruby-version: "2.7"
1212
bundler-cache: true
1313
- run: bundle exec rubocop

.github/workflows/test.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,28 @@ on: [push, pull_request]
33
jobs:
44
test:
55
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
ruby:
10+
- "2.7"
11+
- "3.0"
12+
- "3.1"
13+
- "3.2"
614
steps:
7-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
816
- name: Set up Ruby
917
uses: ruby/setup-ruby@v1
1018
with:
11-
ruby-version: 3.1.1
19+
ruby-version: ${{ matrix.ruby }}
1220
bundler-cache: true
1321
- uses: browser-actions/setup-geckodriver@latest
1422
with:
15-
geckodriver-version: 0.18.0
16-
- uses: browser-actions/setup-firefox@latest
23+
geckodriver-version: "0.32.2"
24+
- uses: browser-actions/setup-firefox@v1
1725
with:
18-
firefox-version: '54.0'
26+
firefox-version: "111.0.1"
1927
- uses: GabrielBB/xvfb-action@v1
2028
with:
2129
run: |
22-
bundle exec rake spec
30+
bundle exec rake spec

Gemfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
source 'http://rubygems.org'
22

3-
ruby '3.1.1'
4-
53
gem 'grape'
64
gem 'grape-entity'
75
gem 'grape-swagger'
@@ -10,6 +8,7 @@ gem 'json'
108
gem 'mime-types'
119
gem 'newrelic_rpm'
1210
gem 'nokogiri'
11+
gem 'rack', '< 3'
1312
gem 'rack-cors'
1413
gem 'webrick'
1514

Gemfile.lock

+63-66
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ GEM
66
i18n (>= 1.6, < 2)
77
minitest (>= 5.1)
88
tzinfo (~> 2.0)
9-
addressable (2.8.0)
10-
public_suffix (>= 2.0.2, < 5.0)
9+
addressable (2.8.1)
10+
public_suffix (>= 2.0.2, < 6.0)
1111
ast (2.4.2)
1212
builder (3.2.4)
13-
capybara (3.37.1)
13+
capybara (3.38.0)
1414
addressable
1515
matrix
1616
mini_mime (>= 0.1.3)
@@ -19,41 +19,36 @@ GEM
1919
rack-test (>= 0.6.3)
2020
regexp_parser (>= 1.5, < 3.0)
2121
xpath (~> 3.2)
22-
childprocess (4.1.0)
2322
coderay (1.1.3)
2423
concurrent-ruby (1.2.2)
2524
diff-lcs (1.5.0)
26-
dry-configurable (0.15.0)
25+
dry-core (1.0.0)
2726
concurrent-ruby (~> 1.0)
28-
dry-core (~> 0.6)
29-
dry-container (0.9.0)
27+
zeitwerk (~> 2.6)
28+
dry-inflector (1.0.0)
29+
dry-logic (1.5.0)
3030
concurrent-ruby (~> 1.0)
31-
dry-configurable (~> 0.13, >= 0.13.0)
32-
dry-core (0.7.1)
31+
dry-core (~> 1.0, < 2)
32+
zeitwerk (~> 2.6)
33+
dry-types (1.7.1)
3334
concurrent-ruby (~> 1.0)
34-
dry-inflector (0.2.1)
35-
dry-logic (1.2.0)
36-
concurrent-ruby (~> 1.0)
37-
dry-core (~> 0.5, >= 0.5)
38-
dry-types (1.5.1)
39-
concurrent-ruby (~> 1.0)
40-
dry-container (~> 0.3)
41-
dry-core (~> 0.5, >= 0.5)
42-
dry-inflector (~> 0.1, >= 0.1.2)
43-
dry-logic (~> 1.0, >= 1.0.2)
35+
dry-core (~> 1.0)
36+
dry-inflector (~> 1.0)
37+
dry-logic (~> 1.4)
38+
zeitwerk (~> 2.6)
4439
ffi (1.15.5)
4540
formatador (1.1.0)
46-
grape (1.6.2)
41+
grape (1.7.0)
4742
activesupport
4843
builder
4944
dry-types (>= 1.1)
5045
mustermann-grape (~> 1.0.0)
5146
rack (>= 1.3.0)
5247
rack-accept
53-
grape-entity (0.10.1)
48+
grape-entity (1.0.0)
5449
activesupport (>= 3.0.0)
5550
multi_json (>= 1.3.2)
56-
grape-swagger (1.4.2)
51+
grape-swagger (1.6.0)
5752
grape (~> 1.3)
5853
grape-swagger-entity (0.5.1)
5954
grape-entity (>= 0.6.0)
@@ -67,7 +62,7 @@ GEM
6762
pry (>= 0.13.0)
6863
shellany (~> 0.0)
6964
thor (>= 0.18.1)
70-
guard-bundler (3.0.0)
65+
guard-bundler (3.0.1)
7166
bundler (>= 2.1, < 3)
7267
guard (~> 2.2)
7368
guard-compat (~> 1.1)
@@ -78,87 +73,90 @@ GEM
7873
spoon
7974
i18n (1.12.0)
8075
concurrent-ruby (~> 1.0)
81-
json (2.6.2)
82-
listen (3.7.1)
76+
json (2.6.3)
77+
listen (3.8.0)
8378
rb-fsevent (~> 0.10, >= 0.10.3)
8479
rb-inotify (~> 0.9, >= 0.9.10)
8580
lumberjack (1.2.8)
8681
matrix (0.4.2)
8782
method_source (1.0.0)
8883
mime-types (3.4.1)
8984
mime-types-data (~> 3.2015)
90-
mime-types-data (3.2022.0105)
85+
mime-types-data (3.2023.0218.1)
9186
mini_mime (1.1.2)
92-
mini_portile2 (2.8.0)
87+
mini_portile2 (2.8.1)
9388
minitest (5.18.0)
9489
multi_json (1.15.0)
95-
mustermann (1.1.1)
90+
mustermann (3.0.0)
9691
ruby2_keywords (~> 0.0.1)
9792
mustermann-grape (1.0.2)
9893
mustermann (>= 1.0.0)
9994
nenv (0.3.0)
100-
newrelic_rpm (8.8.0)
101-
nokogiri (1.13.10)
95+
newrelic_rpm (9.0.0)
96+
nokogiri (1.14.2)
10297
mini_portile2 (~> 2.8.0)
10398
racc (~> 1.4)
10499
notiffany (0.1.3)
105100
nenv (~> 0.1)
106101
shellany (~> 0.0)
107102
parallel (1.22.1)
108-
parser (3.1.2.0)
103+
parser (3.2.1.1)
109104
ast (~> 2.4.1)
110-
pry (0.14.1)
105+
pry (0.14.2)
111106
coderay (~> 1.1)
112107
method_source (~> 1.0)
113-
public_suffix (4.0.7)
114-
racc (1.6.1)
108+
public_suffix (5.0.1)
109+
racc (1.6.2)
115110
rack (2.2.6.4)
116111
rack-accept (0.4.5)
117112
rack (>= 0.4)
118-
rack-cors (1.1.1)
113+
rack-cors (2.0.1)
119114
rack (>= 2.0.0)
120-
rack-test (1.1.0)
121-
rack (>= 1.0, < 3)
115+
rack-test (2.1.0)
116+
rack (>= 1.3)
122117
rainbow (3.1.1)
123118
rake (13.0.6)
124-
rb-fsevent (0.11.1)
119+
rb-fsevent (0.11.2)
125120
rb-inotify (0.10.1)
126121
ffi (~> 1.0)
127-
regexp_parser (2.5.0)
122+
regexp_parser (2.7.0)
128123
rexml (3.2.5)
129-
rspec (3.11.0)
130-
rspec-core (~> 3.11.0)
131-
rspec-expectations (~> 3.11.0)
132-
rspec-mocks (~> 3.11.0)
133-
rspec-core (3.11.0)
134-
rspec-support (~> 3.11.0)
135-
rspec-expectations (3.11.0)
124+
rspec (3.12.0)
125+
rspec-core (~> 3.12.0)
126+
rspec-expectations (~> 3.12.0)
127+
rspec-mocks (~> 3.12.0)
128+
rspec-core (3.12.1)
129+
rspec-support (~> 3.12.0)
130+
rspec-expectations (3.12.2)
136131
diff-lcs (>= 1.2.0, < 2.0)
137-
rspec-support (~> 3.11.0)
138-
rspec-mocks (3.11.1)
132+
rspec-support (~> 3.12.0)
133+
rspec-mocks (3.12.4)
139134
diff-lcs (>= 1.2.0, < 2.0)
140-
rspec-support (~> 3.11.0)
141-
rspec-support (3.11.0)
142-
rubocop (1.30.1)
135+
rspec-support (~> 3.12.0)
136+
rspec-support (3.12.0)
137+
rubocop (1.48.1)
138+
json (~> 2.3)
143139
parallel (~> 1.10)
144-
parser (>= 3.1.0.0)
140+
parser (>= 3.2.0.0)
145141
rainbow (>= 2.2.2, < 4.0)
146142
regexp_parser (>= 1.8, < 3.0)
147143
rexml (>= 3.2.5, < 4.0)
148-
rubocop-ast (>= 1.18.0, < 2.0)
144+
rubocop-ast (>= 1.26.0, < 2.0)
149145
ruby-progressbar (~> 1.7)
150-
unicode-display_width (>= 1.4.0, < 3.0)
151-
rubocop-ast (1.18.0)
152-
parser (>= 3.1.1.0)
146+
unicode-display_width (>= 2.4.0, < 3.0)
147+
rubocop-ast (1.28.0)
148+
parser (>= 3.2.1.0)
149+
rubocop-capybara (2.17.1)
150+
rubocop (~> 1.41)
153151
rubocop-rake (0.6.0)
154152
rubocop (~> 1.0)
155-
rubocop-rspec (2.11.1)
156-
rubocop (~> 1.19)
157-
ruby-progressbar (1.11.0)
153+
rubocop-rspec (2.19.0)
154+
rubocop (~> 1.33)
155+
rubocop-capybara (~> 2.17)
156+
ruby-progressbar (1.13.0)
158157
ruby2_keywords (0.0.5)
159158
rubyzip (2.3.2)
160-
selenium-webdriver (4.2.1)
161-
childprocess (>= 0.5, < 5.0)
159+
selenium-webdriver (4.8.2)
162160
rexml (~> 3.2, >= 3.2.5)
163161
rubyzip (>= 1.2.2, < 3.0)
164162
websocket (~> 1.0)
@@ -168,11 +166,12 @@ GEM
168166
thor (1.2.1)
169167
tzinfo (2.0.6)
170168
concurrent-ruby (~> 1.0)
171-
unicode-display_width (2.1.0)
172-
webrick (1.7.0)
169+
unicode-display_width (2.4.2)
170+
webrick (1.8.1)
173171
websocket (1.2.9)
174172
xpath (3.2.0)
175173
nokogiri (~> 1.8)
174+
zeitwerk (2.6.7)
176175

177176
PLATFORMS
178177
ruby
@@ -190,6 +189,7 @@ DEPENDENCIES
190189
mime-types
191190
newrelic_rpm
192191
nokogiri
192+
rack (< 3)
193193
rack-cors
194194
rack-test
195195
rake
@@ -200,8 +200,5 @@ DEPENDENCIES
200200
selenium-webdriver
201201
webrick
202202

203-
RUBY VERSION
204-
ruby 3.1.1p18
205-
206203
BUNDLED WITH
207204
2.3.15

api/wrap_response_decorator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def initialize(app)
77
def call(env)
88
status, headers, body_proxy = @app.call(env)
99
bodies = body_proxy.map do |body|
10-
{ body: JSON.parse(body), status: }.to_json
10+
{ body: JSON.parse(body), status: status }.to_json
1111
end
1212
[200, headers, bodies]
1313
end

config/application.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Bundler.require :default, ENV.fetch('RACK_ENV', nil)
88

9-
Dir[File.expand_path('../api/*.rb', __dir__)].each do |f|
9+
Dir[File.expand_path('../api/*.rb', __dir__)].sort.each do |f|
1010
require f
1111
end
1212

spec/api/headers_spec.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ def app
1111
get '/api/headers'
1212
expect(JSON.parse(last_response.body)).to eq(
1313
'Cookie' => '',
14-
'Host' => 'example.org'
14+
'Host' => 'example.org',
15+
'Version' => 'HTTP/1.0'
1516
)
1617
end
1718

@@ -38,7 +39,8 @@ def app
3839
expect(JSON.parse(last_response.body)).to eq(
3940
'Cookie' => '',
4041
'Host' => 'example.org',
41-
'Reticulated-Spline' => 42
42+
'Reticulated-Spline' => 42,
43+
'Version' => 'HTTP/1.0'
4244
)
4345
end
4446
end

0 commit comments

Comments
 (0)