Skip to content

Commit

Permalink
test_config.rb - remove a rack3 skip
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Jan 31, 2023
1 parent 5f4f71a commit 79e81d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions test/rackup/hello-bind_rack3.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run lambda { |env| [200, {"Content-Type" => "text/plain"}, ["Hello World"]] }
15 changes: 12 additions & 3 deletions test/test_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ def test_default_max_threads
end

def test_app_from_rackup
skip_if :rack3
if Rack::RELEASE >= '3'
fn = "test/rackup/hello-bind_rack3.ru"
bind = "tcp://0.0.0.0:9292"
else
fn = "test/rackup/hello-bind.ru"
bind = "tcp://127.0.0.1:9292"
end

conf = Puma::Configuration.new do |c|
c.rackup "test/rackup/hello-bind.ru"
c.rackup fn
end
conf.load

Expand All @@ -29,7 +36,9 @@ def test_app_from_rackup
conf.app
end

assert_equal ["tcp://127.0.0.1:9292"], conf.options[:binds]
assert_equal [200, {"Content-Type"=>"text/plain"}, ["Hello World"]], conf.app.call({})

assert_equal [bind], conf.options[:binds]
end

def test_app_from_app_DSL
Expand Down

0 comments on commit 79e81d0

Please sign in to comment.