mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Add some tests to envs in binder
This commit is contained in:
parent
2cef8ddae1
commit
800179242d
2 changed files with 19 additions and 1 deletions
|
@ -43,7 +43,7 @@ module Puma
|
|||
@ios = []
|
||||
end
|
||||
|
||||
attr_reader :ios, :listeners, :unix_paths
|
||||
attr_reader :ios, :listeners, :unix_paths, :proto_env, :envs
|
||||
|
||||
def env(sock)
|
||||
@envs.fetch(sock, @proto_env)
|
||||
|
|
|
@ -138,6 +138,24 @@ class TestBinder < TestBinderBase
|
|||
refute ssl_context_for_binder.no_tlsv1_1
|
||||
end
|
||||
|
||||
def test_env_contains_protoenv
|
||||
@binder.parse ["ssl://localhost:0?#{ssl_query}"], @events
|
||||
|
||||
env_hash = @binder.envs[@binder.ios.first]
|
||||
|
||||
@binder.proto_env.each do |k,v|
|
||||
assert_equal env_hash[k], v
|
||||
end
|
||||
end
|
||||
|
||||
def test_env_contains_stderr
|
||||
@binder.parse ["ssl://localhost:0?#{ssl_query}"], @events
|
||||
|
||||
env_hash = @binder.envs[@binder.ios.first]
|
||||
|
||||
assert_equal @events.stderr, env_hash["rack.errors"]
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def assert_parsing_logs_uri(order = [:unix, :tcp])
|
||||
|
|
Loading…
Add table
Reference in a new issue