Skip to content

Commit

Permalink
chore: add appraisals to allow testing with rack 2 and rack 3
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Nov 9, 2023
1 parent 44c084f commit 87b269b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ jobs:
matrix:
ruby_version: ["3.2"]
os: ["ubuntu-latest","windows-latest","macos-latest"]
env:
BUNDLE_GEMFILE: rack-2.gemfile
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: "bundle exec rake"
- run: "bundle exec appraisal install"
- run: "bundle exec appraisal rack-2 rake"
test-with-active-support:
runs-on: ${{ matrix.os }}
env:
Expand All @@ -57,4 +56,5 @@ jobs:
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- run: "bundle exec rake spec_with_active_support"
- run: "bundle exec appraisal install"
- run: "bundle exec appraisal activesupport rake spec_with_active_support"
11 changes: 11 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
appraise "rack-2" do
gem "rack", "~> 2.0"

group :test do
remove_gem "rackup"
end
end

appraise "activesupport" do
gem "activesupport", "~> 5.1"
end
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ gemspec
# Diff:

gem "rspec-mocks", "3.10.2"
gem "appraisal", "~> 2.5"

if ENV['X_PACT_DEVELOPMENT']
gem "pact-support", path: '../pact-support'
Expand Down
10 changes: 0 additions & 10 deletions active-support.gemfile

This file was deleted.

3 changes: 0 additions & 3 deletions rack-2.gemfile

This file was deleted.

6 changes: 5 additions & 1 deletion spec/support/ssl_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ def webrick_opts port
require "webrick"
require "webrick/https"
require "rack"
require "rackup/handler/webrick"
begin
require "rackup/handler/webrick" # rack 3
rescue LoadError
require "rack/handler/webrick" # rack 2
end

opts = webrick_opts(4444)

Expand Down

0 comments on commit 87b269b

Please sign in to comment.