Skip to content

Commit 6f9e6df

Browse files
authored
Merge pull request #292 from pact-foundation/ruby_3_2
Ruby 3 2
2 parents 8f62f4f + d8d65b6 commit 6f9e6df

15 files changed

+39
-27
lines changed

.github/workflows/release_gem.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- uses: ruby/setup-ruby@v1
1515
with:
16-
ruby-version: '2.6'
16+
ruby-version: '3.2'
1717
- run: |
18-
gem install bundler -v 2.1
18+
gem install bundler -v 2.4
1919
bundle install
2020
- name: Test
2121
run: bundle exec rake
@@ -28,7 +28,7 @@ jobs:
2828
version: ${{ steps.release-gem.outputs.version }}
2929
increment: ${{ steps.release-gem.outputs.increment }}
3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
with:
3333
fetch-depth: 0
3434
- id: release-gem

.github/workflows/test.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,36 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
runs-on: "ubuntu-latest"
7+
runs-on: ${{ matrix.os }}
88
strategy:
99
fail-fast: false
1010
matrix:
11-
ruby_version: ["2.4", "2.7", "3.0"]
11+
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
12+
os: ["ubuntu-latest","windows-latest","macos-latest"]
13+
# defaults:
14+
# run:
15+
# shell: bash
1216
steps:
13-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1418
- uses: ruby/setup-ruby@v1
1519
with:
1620
ruby-version: ${{ matrix.ruby_version }}
1721
bundler-cache: true
1822
- run: "bundle exec rake"
1923
test-with-active-support:
20-
runs-on: "ubuntu-latest"
24+
runs-on: ${{ matrix.os }}
2125
env:
2226
BUNDLE_GEMFILE: active-support.gemfile
2327
strategy:
2428
fail-fast: false
2529
matrix:
26-
ruby_version: ["2.7", "3.0"]
30+
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
31+
os: ["ubuntu-latest","windows-latest","macos-latest"]
32+
defaults:
33+
run:
34+
shell: bash
2735
steps:
28-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v3
2937
- uses: ruby/setup-ruby@v1
3038
with:
3139
ruby-version: ${{ matrix.ruby_version }}

example/zoo-app/spec/service_providers/pact_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Pact.service_consumer 'Zoo App' do
99
has_pact_with "Animal Service" do
1010
mock_service :animal_service do
11-
port 1234
11+
port 8888
1212
pact_specification_version "2.0.0"
1313
end
1414
end

pact.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Gem::Specification.new do |gem|
3737

3838
gem.add_development_dependency 'rake', '~> 13.0'
3939
gem.add_development_dependency 'webmock', '~> 3.0'
40-
gem.add_development_dependency 'fakefs', '0.5' # 0.6.0 blows up
40+
gem.add_development_dependency 'fakefs', '2.4' # 0.6.0 blows up
4141
gem.add_development_dependency 'hashie', '~> 2.0'
4242
gem.add_development_dependency 'faraday', '~>1.0', '<3.0'
4343
gem.add_development_dependency 'faraday-multipart', '~> 1.0'

spec/features/consumption_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
has_pact_with "Alice Service" do
2020
mock_service :alice_service do
2121
verify true
22-
port 1234
22+
port 8888
2323
end
2424
end
2525

@@ -76,7 +76,7 @@
7676
})
7777

7878

79-
alice_response = Net::HTTP.get_response(URI('http://localhost:1234/mallory'))
79+
alice_response = Net::HTTP.get_response(URI('http://localhost:8888/mallory'))
8080

8181
expect(alice_response.code).to eql '200'
8282
expect(alice_response['Content-Type']).to eql 'text/html'

spec/integration/cli_docs_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'support/cli'
33
require 'fileutils'
44

5-
describe "running the pact docs CLI" do
5+
describe "running the pact docs CLI", skip_windows: true do
66

77
include Pact::Support::CLI
88

spec/integration/cli_spec.rb

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

4-
describe "running the pact verify CLI" do
4+
describe "running the pact verify CLI", skip_windows: true do
55

66
include Pact::Support::CLI
77

spec/integration/executing_verify_from_wrapper_language_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RSpec.describe "executing pact verify" do
1+
RSpec.describe "executing pact verify", skip_windows: true do
22
let(:command) { "bundle exec rake pact:verify:test_app:fail > /dev/null" }
33
let(:reports_dir) { 'tmp/spec_reports' } # The config for this is in spec/support/pact_helper.rb
44

spec/integration/pact/consumer_configuration_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TestHelper
2727

2828
has_pact_with "My Service" do
2929
mock_service :my_service do
30-
port 1234
30+
port 8888
3131
standalone true
3232
end
3333
end
@@ -52,7 +52,7 @@ class TestHelper
5252

5353
context "when standalone is true" do
5454
it "is not registerd with the AppManager" do
55-
expect(Pact::MockService::AppManager.instance.app_registered_on?(1234)).to eq false
55+
expect(Pact::MockService::AppManager.instance.app_registered_on?(8888)).to eq false
5656
end
5757
end
5858

spec/lib/pact/consumer/configuration_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Pact::Consumer::Configuration
66
describe MockService do
77

88
let(:world) { Pact::Consumer::World.new }
9-
let(:port_number) { 1234 }
9+
let(:port_number) { 8888 }
1010
before do
1111
Pact.clear_configuration
1212
allow(Pact::MockService::AppManager.instance).to receive(:register_mock_service_for).and_return(port_number)

spec/lib/pact/consumer/consumer_contract_builder_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ module Consumer
7272
consumer_name: consumer_name,
7373
provider_name: provider_name,
7474
host: 'localhost',
75-
port: 1234
75+
port: 8888
7676
)
7777
end
7878

7979
it "returns the mock service base URL" do
80-
expect(subject.mock_service_base_url).to eq("http://localhost:1234")
80+
expect(subject.mock_service_base_url).to eq("http://localhost:8888")
8181
end
8282
end
8383

spec/lib/pact/provider/rspec/formatter_rspec_3_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module RSpec
3232
let(:examples) { [example, example, example_2]}
3333
let(:output) { StringIO.new }
3434
let(:rerun_command) { 'PACT_DESCRIPTION="a description" PACT_PROVIDER_STATE="a state" # an interaction' }
35-
let(:broker_rerun_command) { "rake pact:verify:at[pact_file_uri] PACT_BROKER_INTERACTION_ID=\"1234\" # an interaction" }
35+
let(:broker_rerun_command) { "rake pact:verify:at[pact_file_uri] PACT_BROKER_INTERACTION_ID=\"8888\" # an interaction" }
3636
let(:missing_provider_states) { 'missing_provider_states'}
3737
let(:summary) { double("summary", failure_count: 1, failed_examples: failed_examples, examples: examples)}
3838
let(:pact_executing_language) { 'ruby' }
@@ -77,7 +77,7 @@ module RSpec
7777

7878
context "when PACT_INTERACTION_RERUN_COMMAND_FOR_BROKER is set" do
7979
context "when the _id is populated" do
80-
let(:id) { "1234" }
80+
let(:id) { "8888" }
8181

8282
it "prints a list of rerun commands" do
8383
expect(output_result).to include(broker_rerun_command)
@@ -100,10 +100,10 @@ module RSpec
100100
let(:pact_interaction_rerun_command_for_broker) { nil }
101101

102102
context "when the _id is populated" do
103-
let(:id) { "1234" }
103+
let(:id) { "8888" }
104104

105105
it "prints a list of failed interactions" do
106-
expect(output_result).to include('* an interaction (to re-run just this interaction, set environment variable PACT_BROKER_INTERACTION_ID="1234")')
106+
expect(output_result).to include('* an interaction (to re-run just this interaction, set environment variable PACT_BROKER_INTERACTION_ID="8888")')
107107
end
108108
end
109109

spec/service_providers/helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Pact.service_consumer 'Pact Ruby' do
44
has_pact_with 'Pact Broker' do
55
mock_service :pact_broker do
6-
port 1234
6+
port 8888
77
pact_specification_version '2.0.0'
88
end
99
end

spec/spec_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
require './spec/support/warning_silencer'
1414

1515
is_jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
16+
is_windows = Gem.win_platform?
1617

1718
RSpec.configure do | config |
1819
config.include(FakeFS::SpecHelpers, fakefs: true)
@@ -25,4 +26,5 @@
2526
config.example_status_persistence_file_path = "./spec/examples.txt"
2627
end
2728
config.filter_run_excluding skip_jruby: is_jruby
29+
config.filter_run_excluding skip_windows: is_windows
2830
end

tasks/pact-test.rake

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ namespace :pact do
6969

7070
desc "All the verification tests"
7171
task "tests:all" do
72+
next if Gem.win_platform?
73+
7274
Rake::Task['pact:verify:stubbing'].execute
7375
Rake::Task['spec:standalone:pass'].execute
7476
Rake::Task['pact:verify'].execute

0 commit comments

Comments
 (0)