Skip to content

Commit

Permalink
Run tests against both Rack 2.x.x and 3.x.x
Browse files Browse the repository at this point in the history
This ensures we’re backwardsly compatible with both versions of Rack.
  • Loading branch information
pezholio committed Jun 14, 2024
1 parent 77e8d41 commit ac03bce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ jobs:
matrix:
ruby_version: ["2.7", "3.0", "3.1", "3.2", "3.3"]
os: ["ubuntu-latest","windows-latest","macos-latest"]
rack_version: ["2", "3"]
runs-on: ${{ matrix.os }}
env:
RACK_VERSION: ${{ matrix.rack_version }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
Expand Down
8 changes: 6 additions & 2 deletions pact-mock_service.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.license = 'MIT'

gem.add_runtime_dependency 'rack', '>= 2.0', '< 4.0'
gem.add_runtime_dependency 'rackup', '~> 2.0'
if ENV['RACK_VERSION'] == '2'
gem.add_runtime_dependency 'rack', '>= 2.0', '< 3.0'
else
gem.add_runtime_dependency 'rack', '>= 3.0', '< 4.0'
gem.add_runtime_dependency 'rackup', '~> 2.0'
end
gem.add_runtime_dependency 'rspec', '>=2.14'
gem.add_runtime_dependency 'find_a_port', '~> 1.0.1'
gem.add_runtime_dependency 'thor', '>= 0.19', '< 2.0'
Expand Down

0 comments on commit ac03bce

Please sign in to comment.