Skip to content

Commit bac548d

Browse files
authored
Merge pull request #103 from pact-foundation/ruby_3_2
Ruby 3 2
2 parents a0d01b9 + 8c9faa3 commit bac548d

15 files changed

+176
-138
lines changed

.github/workflows/release_gem.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
version: ${{ steps.release-gem.outputs.version }}
1515
increment: ${{ steps.release-gem.outputs.increment }}
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
with:
1919
fetch-depth: 0
2020
- id: release-gem

.github/workflows/test.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
runs-on: "ubuntu-latest"
8-
continue-on-error: ${{ matrix.experimental }}
7+
runs-on: ${{ matrix.os }}
98
strategy:
109
fail-fast: false
1110
matrix:
12-
ruby_version: ["2.4", "2.7"]
13-
experimental: [false]
14-
include:
15-
- ruby_version: "3.0"
16-
experimental: true
11+
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
12+
os: ["ubuntu-latest","windows-latest","macos-latest"]
1713
steps:
18-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1915
- uses: ruby/setup-ruby@v1
2016
with:
2117
ruby-version: ${{ matrix.ruby_version }}

examples/Gemfile.lock

+41-40
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GEM
55
diff-lcs (1.5.0)
66
expgen (0.1.1)
77
parslet
8-
faraday (1.10.0)
8+
faraday (1.10.3)
99
faraday-em_http (~> 1.0)
1010
faraday-em_synchrony (~> 1.0)
1111
faraday-excon (~> 1.1)
@@ -21,8 +21,8 @@ GEM
2121
faraday-em_synchrony (1.0.0)
2222
faraday-excon (1.1.0)
2323
faraday-httpclient (1.0.1)
24-
faraday-multipart (1.0.3)
25-
multipart-post (>= 1.2, < 3)
24+
faraday-multipart (1.0.4)
25+
multipart-post (~> 2)
2626
faraday-net_http (1.0.1)
2727
faraday-net_http_persistent (1.2.0)
2828
faraday-patron (1.0.0)
@@ -32,15 +32,15 @@ GEM
3232
faraday (~> 1.0)
3333
filelock (1.1.1)
3434
find_a_port (1.0.1)
35-
json (2.6.2)
35+
json (2.6.3)
3636
multi_json (1.15.0)
37-
multipart-post (2.1.1)
38-
mustermann (1.1.1)
37+
multipart-post (2.3.0)
38+
mustermann (3.0.0)
3939
ruby2_keywords (~> 0.0.1)
40-
pact (1.62.0)
40+
pact (1.63.0)
4141
pact-mock_service (~> 3.0, >= 3.3.1)
4242
pact-support (~> 1.16, >= 1.16.9)
43-
rack-test (>= 0.6.3, < 2.0.0)
43+
rack-test (>= 0.6.3, < 3.0.0)
4444
rspec (~> 3.0)
4545
term-ansicolor (~> 1.0)
4646
thor (>= 0.20, < 2.0)
@@ -49,7 +49,7 @@ GEM
4949
pact-mock_service (~> 3.1)
5050
pact-support (~> 1.8)
5151
thor (>= 0.20, < 2.0)
52-
pact-mock_service (3.10.0)
52+
pact-mock_service (3.11.0)
5353
filelock (~> 1.1)
5454
find_a_port (~> 1.0.1)
5555
json
@@ -69,57 +69,58 @@ GEM
6969
rack-reverse-proxy
7070
rspec (~> 3.5)
7171
rspec_junit_formatter (~> 0.3)
72-
pact-support (1.17.0)
72+
pact-support (1.19.0)
7373
awesome_print (~> 1.9)
7474
diff-lcs (~> 1.4)
7575
expgen (~> 0.1)
76-
term-ansicolor (~> 1.0)
76+
rainbow (~> 3.1.1)
7777
parslet (2.0.0)
78-
rack (2.2.3.1)
79-
rack-protection (2.2.0)
78+
rack (2.2.7)
79+
rack-protection (3.0.6)
8080
rack
81-
rack-proxy (0.7.2)
81+
rack-proxy (0.7.6)
8282
rack
8383
rack-reverse-proxy (0.12.0)
8484
rack (>= 1.0.0)
8585
rack-proxy (~> 0.6, >= 0.6.1)
86-
rack-test (1.1.0)
87-
rack (>= 1.0, < 3)
88-
rspec (3.11.0)
89-
rspec-core (~> 3.11.0)
90-
rspec-expectations (~> 3.11.0)
91-
rspec-mocks (~> 3.11.0)
92-
rspec-core (3.11.0)
93-
rspec-support (~> 3.11.0)
94-
rspec-expectations (3.11.0)
86+
rack-test (2.1.0)
87+
rack (>= 1.3)
88+
rainbow (3.1.1)
89+
rspec (3.12.0)
90+
rspec-core (~> 3.12.0)
91+
rspec-expectations (~> 3.12.0)
92+
rspec-mocks (~> 3.12.0)
93+
rspec-core (3.12.2)
94+
rspec-support (~> 3.12.0)
95+
rspec-expectations (3.12.3)
9596
diff-lcs (>= 1.2.0, < 2.0)
96-
rspec-support (~> 3.11.0)
97-
rspec-mocks (3.11.1)
97+
rspec-support (~> 3.12.0)
98+
rspec-mocks (3.12.5)
9899
diff-lcs (>= 1.2.0, < 2.0)
99-
rspec-support (~> 3.11.0)
100-
rspec-support (3.11.0)
101-
rspec_junit_formatter (0.5.1)
100+
rspec-support (~> 3.12.0)
101+
rspec-support (3.12.0)
102+
rspec_junit_formatter (0.6.0)
102103
rspec-core (>= 2, < 4, != 2.12.0)
103104
ruby2_keywords (0.0.5)
104-
sinatra (2.2.0)
105-
mustermann (~> 1.0)
106-
rack (~> 2.2)
107-
rack-protection (= 2.2.0)
105+
sinatra (3.0.6)
106+
mustermann (~> 3.0)
107+
rack (~> 2.2, >= 2.2.4)
108+
rack-protection (= 3.0.6)
108109
tilt (~> 2.0)
109-
sinatra-contrib (2.2.0)
110+
sinatra-contrib (3.0.6)
110111
multi_json
111-
mustermann (~> 1.0)
112-
rack-protection (= 2.2.0)
113-
sinatra (= 2.2.0)
112+
mustermann (~> 3.0)
113+
rack-protection (= 3.0.6)
114+
sinatra (= 3.0.6)
114115
tilt (~> 2.0)
115116
sync (0.5.0)
116117
term-ansicolor (1.7.1)
117118
tins (~> 1.0)
118119
thor (1.2.1)
119-
tilt (2.0.10)
120-
tins (1.31.1)
120+
tilt (2.1.0)
121+
tins (1.32.1)
121122
sync
122-
webrick (1.7.0)
123+
webrick (1.8.1)
123124

124125
PLATFORMS
125126
ruby
@@ -130,4 +131,4 @@ DEPENDENCIES
130131
sinatra-contrib
131132

132133
BUNDLED WITH
133-
1.17.3
134+
2.4.10

spec/integration_check_host_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe "pact-provider-verifier" do
1+
describe "pact-provider-verifier", skip_windows: true do
22
before(:all) do
33
@pipe = IO.popen("bundle exec rackup -p 4569 spec/support/provider-echo-host.ru")
44
sleep 2

spec/integration_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'json'
22
require 'fileutils'
33

4-
describe "pact-provider-verifier" do
4+
describe "pact-provider-verifier", skip_windows: true do
55
before(:all) do
66
@pipe = IO.popen("bundle exec rackup -p 4567 spec/support/config.ru")
77
sleep 2

spec/integration_verify_message_pact_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'pact/provider_verifier/app'
22

3-
RSpec.describe "verifying a message pact" do
3+
RSpec.describe "verifying a message pact", skip_windows: true do
44

55
before(:all) do
66
@pipe = IO.popen("rackup -p 9393 spec/support/message_producer_verifier.ru")

spec/integration_with_custom_header_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe "pact-provider-verifier with basic auth" do
1+
describe "pact-provider-verifier with basic auth", skip_windows: true do
22
before(:all) do
33
@pipe = IO.popen({'USE_BASIC_AUTH' => 'true'}, %w{bundle exec rackup -p 4570 spec/support/config.ru})
44
sleep 2

spec/integration_with_custom_middleware_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe "pact-provider-verifier with basic auth" do
1+
describe "pact-provider-verifier with basic auth", skip_windows: true do
22
before(:all) do
33
@pipe = IO.popen({'USE_BASIC_AUTH' => 'true'}, %w{bundle exec rackup -p 4570 spec/support/config.ru})
44
sleep 2

spec/integration_with_monkeypatch_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe "pact-provider-verifier with monkeypatch" do
1+
describe "pact-provider-verifier with monkeypatch", skip_windows: true do
22
before(:all) do
33
@pipe = IO.popen({}, %w{bundle exec rackup -p 4870 spec/support/config.ru})
44
sleep 2

spec/integration_with_prefix_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'json'
22

3-
describe "pact-provider-verifier with a prefix path in the base URL" do
3+
describe "pact-provider-verifier with a prefix path in the base URL", skip_windows: true do
44
before(:all) do
55
@pipe = IO.popen("bundle exec rackup -p 5837 spec/support/config_with_prefix.ru")
66
sleep 2

spec/integration_with_ssl_no_verify_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'support/provider_with_self_signed_cert'
22
require 'find_a_port'
33

4-
describe "verifying a provider that uses a self signed certificate" do
4+
describe "verifying a provider that uses a self signed certificate", skip_windows: true do
55

66
it "passes because it has SSL verification turned off" do
77
begin

spec/integration_with_underscored_header_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'find_a_port'
22

3-
describe "pact-provider-verifier with an underscored header" do
3+
describe "pact-provider-verifier with an underscored header", skip_windows: true do
44
before(:all) do
55
@port = FindAPort.available_port
66
@pipe = IO.popen({}, %W{ruby spec/support/provider_with_no_rack.rb #{@port}})

spec/spec_helper.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
ENV['PACT_BROKER_USERNAME'] = nil
22
ENV['PACT_BROKER_PASSWORD'] = nil
33
ENV['PACT_BROKER_TOKEN'] = nil
4+
is_windows = Gem.win_platform?
45

56
RSpec.configure do | config |
67

8+
79
if config.respond_to?(:example_status_persistence_file_path=)
810
config.example_status_persistence_file_path = "./spec/examples.txt"
911
end
10-
12+
config.filter_run_excluding skip_windows: is_windows
1113
end

spec/support/provider_with_self_signed_cert.rb

+10-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ def run_provider_with_self_signed_cert port
77
require 'webrick/https'
88

99
webrick_opts = {:Port => port, :SSLEnable => true, :SSLCertName => [%w[CN localhost]]}
10-
Rack::Handler::WEBrick.run(Provider, webrick_opts) do |server|
11-
@server = server
10+
# https://www.rubydoc.info/gems/rack/2.2.6/Rack%2FHandler%2FWEBrick.run
11+
if RUBY_VERSION < "3"
12+
# To work with Ruby 2.7.0, this needs an explicit ruby2_keywords
13+
Rack::Handler::WEBrick.run(Provider, webrick_opts) do |server|
14+
@server = server
15+
end
16+
else
17+
Rack::Handler::WEBrick.run(Provider, **webrick_opts) do |server|
18+
@server = server
19+
end
1220
end
1321
end
1422

0 commit comments

Comments
 (0)