Skip to content

Commit

Permalink
test: Adapt test to Sinatra 4.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Ferenc Géczi <[email protected]>
  • Loading branch information
Ferenc- committed Jan 22, 2024
1 parent b078a2c commit 79fed38
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ library_gemfile: &library_gemfile
- "./gemfiles/sinatra_14.gemfile"
- "./gemfiles/sinatra_22.gemfile"
- "./gemfiles/sinatra_30.gemfile"
- "./gemfiles/sinatra_40.gemfile"
- "./gemfiles/shoryuken_50.gemfile"
- "./gemfiles/shoryuken_60.gemfile"
- "./gemfiles/mongo_216.gemfile"
Expand Down
13 changes: 13 additions & 0 deletions gemfiles/sinatra_40.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# (c) Copyright IBM Corp. 2023

source "https://rubygems.org"

gem "minitest-reporters"
gem "webmock"
gem "puma"
gem "rubocop", "~> 1.9"
gem "rack-test"
gem "simplecov", "~> 0.21.2"
gem "sinatra", ">= 4.0.0"

gemspec path: "../"
6 changes: 5 additions & 1 deletion test/frameworks/sinatra_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

class SinatraTest < Minitest::Test
include Rack::Test::Methods
APP = Rack::Builder.parse_file('test/support/apps/sinatra/config.ru').first
APP = Rack::Builder.parse_file('test/support/apps/sinatra/config.ru')
sinatra_version = Gem::Specification.find_by_name('sinatra').version
if sinatra_version < Gem::Version.new('4.0.0')
APP = APP.first
end

def app
APP
Expand Down

0 comments on commit 79fed38

Please sign in to comment.