Skip to content

Commit

Permalink
test: fix failing sinatra tests for version 4.1.0
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun Rajappa <Arjun.Rajappa@ibm.com>
  • Loading branch information
arjun-rajappa committed Nov 19, 2024
1 parent 7bcb519 commit d2d6bbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 3 additions & 7 deletions test/frameworks/sinatra_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

require 'test_helper'
require 'rack/test'
require 'byebug'

class SinatraTest < Minitest::Test
include Rack::Test::Methods
APP = Rack::Builder.parse_file('test/support/apps/sinatra/config.ru')
byebug

sinatra_version = Gem::Specification.find_by_name('sinatra').version
if sinatra_version < Gem::Version.new('4.0.0')
APP = APP.first
Expand All @@ -19,12 +19,8 @@ def app

def test_basic_get
clear_all!
byebug
r = get '/'
# , nil, {
# "HTTP_FORWARDED" => "localhost",
# "action_dispatch.show_detailed_exceptions" => true
# }

assert last_response.ok?


Expand Down
6 changes: 5 additions & 1 deletion test/support/apps/sinatra/config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ class InstanaSinatraApp < ::Sinatra::Base
get '/' do
"Hello Sinatra!"
end

get '/greet/:name' do
"Hello, #{params[:name]}!"
end

configure do
set :host_authorization, {permitted_hosts: "example.org"}
end
end

run InstanaSinatraApp

0 comments on commit d2d6bbc

Please sign in to comment.