Skip to content

Commit

Permalink
Merge pull request #103 from pact-foundation/ruby_3_2
Browse files Browse the repository at this point in the history
Ruby 3 2
  • Loading branch information
YOU54F authored May 17, 2023
2 parents a0d01b9 + 8c9faa3 commit bac548d
Show file tree
Hide file tree
Showing 15 changed files with 176 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
version: ${{ steps.release-gem.outputs.version }}
increment: ${{ steps.release-gem.outputs.increment }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: release-gem
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ on: [push, pull_request]

jobs:
test:
runs-on: "ubuntu-latest"
continue-on-error: ${{ matrix.experimental }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby_version: ["2.4", "2.7"]
experimental: [false]
include:
- ruby_version: "3.0"
experimental: true
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
os: ["ubuntu-latest","windows-latest","macos-latest"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
Expand Down
81 changes: 41 additions & 40 deletions examples/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GEM
diff-lcs (1.5.0)
expgen (0.1.1)
parslet
faraday (1.10.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand All @@ -21,8 +21,8 @@ GEM
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.3)
multipart-post (>= 1.2, < 3)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
Expand All @@ -32,15 +32,15 @@ GEM
faraday (~> 1.0)
filelock (1.1.1)
find_a_port (1.0.1)
json (2.6.2)
json (2.6.3)
multi_json (1.15.0)
multipart-post (2.1.1)
mustermann (1.1.1)
multipart-post (2.3.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
pact (1.62.0)
pact (1.63.0)
pact-mock_service (~> 3.0, >= 3.3.1)
pact-support (~> 1.16, >= 1.16.9)
rack-test (>= 0.6.3, < 2.0.0)
rack-test (>= 0.6.3, < 3.0.0)
rspec (~> 3.0)
term-ansicolor (~> 1.0)
thor (>= 0.20, < 2.0)
Expand All @@ -49,7 +49,7 @@ GEM
pact-mock_service (~> 3.1)
pact-support (~> 1.8)
thor (>= 0.20, < 2.0)
pact-mock_service (3.10.0)
pact-mock_service (3.11.0)
filelock (~> 1.1)
find_a_port (~> 1.0.1)
json
Expand All @@ -69,57 +69,58 @@ GEM
rack-reverse-proxy
rspec (~> 3.5)
rspec_junit_formatter (~> 0.3)
pact-support (1.17.0)
pact-support (1.19.0)
awesome_print (~> 1.9)
diff-lcs (~> 1.4)
expgen (~> 0.1)
term-ansicolor (~> 1.0)
rainbow (~> 3.1.1)
parslet (2.0.0)
rack (2.2.3.1)
rack-protection (2.2.0)
rack (2.2.7)
rack-protection (3.0.6)
rack
rack-proxy (0.7.2)
rack-proxy (0.7.6)
rack
rack-reverse-proxy (0.12.0)
rack (>= 1.0.0)
rack-proxy (~> 0.6, >= 0.6.1)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rspec_junit_formatter (0.5.1)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
ruby2_keywords (0.0.5)
sinatra (2.2.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.2.0)
sinatra (3.0.6)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.0.6)
tilt (~> 2.0)
sinatra-contrib (2.2.0)
sinatra-contrib (3.0.6)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.2.0)
sinatra (= 2.2.0)
mustermann (~> 3.0)
rack-protection (= 3.0.6)
sinatra (= 3.0.6)
tilt (~> 2.0)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (1.2.1)
tilt (2.0.10)
tins (1.31.1)
tilt (2.1.0)
tins (1.32.1)
sync
webrick (1.7.0)
webrick (1.8.1)

PLATFORMS
ruby
Expand All @@ -130,4 +131,4 @@ DEPENDENCIES
sinatra-contrib

BUNDLED WITH
1.17.3
2.4.10
2 changes: 1 addition & 1 deletion spec/integration_check_host_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe "pact-provider-verifier" do
describe "pact-provider-verifier", skip_windows: true do
before(:all) do
@pipe = IO.popen("bundle exec rackup -p 4569 spec/support/provider-echo-host.ru")
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'json'
require 'fileutils'

describe "pact-provider-verifier" do
describe "pact-provider-verifier", skip_windows: true do
before(:all) do
@pipe = IO.popen("bundle exec rackup -p 4567 spec/support/config.ru")
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_verify_message_pact_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'pact/provider_verifier/app'

RSpec.describe "verifying a message pact" do
RSpec.describe "verifying a message pact", skip_windows: true do

before(:all) do
@pipe = IO.popen("rackup -p 9393 spec/support/message_producer_verifier.ru")
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_with_custom_header_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe "pact-provider-verifier with basic auth" do
describe "pact-provider-verifier with basic auth", skip_windows: true do
before(:all) do
@pipe = IO.popen({'USE_BASIC_AUTH' => 'true'}, %w{bundle exec rackup -p 4570 spec/support/config.ru})
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_with_custom_middleware_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe "pact-provider-verifier with basic auth" do
describe "pact-provider-verifier with basic auth", skip_windows: true do
before(:all) do
@pipe = IO.popen({'USE_BASIC_AUTH' => 'true'}, %w{bundle exec rackup -p 4570 spec/support/config.ru})
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_with_monkeypatch_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe "pact-provider-verifier with monkeypatch" do
describe "pact-provider-verifier with monkeypatch", skip_windows: true do
before(:all) do
@pipe = IO.popen({}, %w{bundle exec rackup -p 4870 spec/support/config.ru})
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_with_prefix_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'json'

describe "pact-provider-verifier with a prefix path in the base URL" do
describe "pact-provider-verifier with a prefix path in the base URL", skip_windows: true do
before(:all) do
@pipe = IO.popen("bundle exec rackup -p 5837 spec/support/config_with_prefix.ru")
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_with_ssl_no_verify_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'support/provider_with_self_signed_cert'
require 'find_a_port'

describe "verifying a provider that uses a self signed certificate" do
describe "verifying a provider that uses a self signed certificate", skip_windows: true do

it "passes because it has SSL verification turned off" do
begin
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_with_underscored_header_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'find_a_port'

describe "pact-provider-verifier with an underscored header" do
describe "pact-provider-verifier with an underscored header", skip_windows: true do
before(:all) do
@port = FindAPort.available_port
@pipe = IO.popen({}, %W{ruby spec/support/provider_with_no_rack.rb #{@port}})
Expand Down
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
ENV['PACT_BROKER_USERNAME'] = nil
ENV['PACT_BROKER_PASSWORD'] = nil
ENV['PACT_BROKER_TOKEN'] = nil
is_windows = Gem.win_platform?

RSpec.configure do | config |


if config.respond_to?(:example_status_persistence_file_path=)
config.example_status_persistence_file_path = "./spec/examples.txt"
end

config.filter_run_excluding skip_windows: is_windows
end
12 changes: 10 additions & 2 deletions spec/support/provider_with_self_signed_cert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ def run_provider_with_self_signed_cert port
require 'webrick/https'

webrick_opts = {:Port => port, :SSLEnable => true, :SSLCertName => [%w[CN localhost]]}
Rack::Handler::WEBrick.run(Provider, webrick_opts) do |server|
@server = server
# https://www.rubydoc.info/gems/rack/2.2.6/Rack%2FHandler%2FWEBrick.run
if RUBY_VERSION < "3"
# To work with Ruby 2.7.0, this needs an explicit ruby2_keywords
Rack::Handler::WEBrick.run(Provider, webrick_opts) do |server|
@server = server
end
else
Rack::Handler::WEBrick.run(Provider, **webrick_opts) do |server|
@server = server
end
end
end

Expand Down
Loading

0 comments on commit bac548d

Please sign in to comment.