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 89100f4 commit e6073e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
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')
railties_version = Gem::Specification.find_by_name('sinatra').version
if railties_version < Gem::Version.new('4.0.0')
APP = APP.first
end

def app
APP
Expand Down

0 comments on commit e6073e1

Please sign in to comment.