2011-12-07 16:42:53 -05:00
|
|
|
require 'test/unit'
|
|
|
|
|
|
|
|
require 'puma'
|
|
|
|
require 'puma/configuration'
|
|
|
|
|
|
|
|
class TestConfigFile < Test::Unit::TestCase
|
|
|
|
def test_app_from_app_DSL
|
|
|
|
opts = { :config_file => "test/config/app.rb" }
|
|
|
|
conf = Puma::Configuration.new opts
|
|
|
|
conf.load
|
|
|
|
|
|
|
|
app = conf.app
|
|
|
|
|
2013-02-06 17:44:51 -05:00
|
|
|
assert_equal [200, {}, ["embedded app"]], app.call({})
|
2011-12-07 16:42:53 -05:00
|
|
|
end
|
2014-02-17 12:07:17 -05:00
|
|
|
|
|
|
|
def test_lowleve_error_handler_DSL
|
|
|
|
opts = { :config_file => "test/config/app.rb" }
|
|
|
|
conf = Puma::Configuration.new opts
|
|
|
|
conf.load
|
|
|
|
|
|
|
|
app = conf.options[:lowlevel_error_handler]
|
|
|
|
|
|
|
|
assert_equal [200, {}, ["error page"]], app.call({})
|
|
|
|
end
|
2011-12-07 16:42:53 -05:00
|
|
|
end
|