Skip to content

Commit ac03bce

Browse files
committed
Run tests against both Rack 2.x.x and 3.x.x
This ensures we’re backwardsly compatible with both versions of Rack.
1 parent 77e8d41 commit ac03bce

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ jobs:
99
matrix:
1010
ruby_version: ["2.7", "3.0", "3.1", "3.2", "3.3"]
1111
os: ["ubuntu-latest","windows-latest","macos-latest"]
12+
rack_version: ["2", "3"]
1213
runs-on: ${{ matrix.os }}
14+
env:
15+
RACK_VERSION: ${{ matrix.rack_version }}
1316
steps:
1417
- uses: actions/checkout@v4
1518
- uses: ruby/setup-ruby@v1

pact-mock_service.gemspec

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ Gem::Specification.new do |gem|
2020
gem.require_paths = ["lib"]
2121
gem.license = 'MIT'
2222

23-
gem.add_runtime_dependency 'rack', '>= 2.0', '< 4.0'
24-
gem.add_runtime_dependency 'rackup', '~> 2.0'
23+
if ENV['RACK_VERSION'] == '2'
24+
gem.add_runtime_dependency 'rack', '>= 2.0', '< 3.0'
25+
else
26+
gem.add_runtime_dependency 'rack', '>= 3.0', '< 4.0'
27+
gem.add_runtime_dependency 'rackup', '~> 2.0'
28+
end
2529
gem.add_runtime_dependency 'rspec', '>=2.14'
2630
gem.add_runtime_dependency 'find_a_port', '~> 1.0.1'
2731
gem.add_runtime_dependency 'thor', '>= 0.19', '< 2.0'

0 commit comments

Comments
 (0)