1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

fix access priorities of each level in LeveledOptions (#1118)

Close #1103
This commit is contained in:
Ari Hiroki 2016-11-21 04:10:34 +09:00 committed by Nate Berkopec
parent f8aac2f164
commit 8509829729
2 changed files with 12 additions and 1 deletions

View file

@ -31,7 +31,7 @@ module Puma
end
def [](key)
@set.each do |o|
@set.reverse_each do |o|
if o.key? key
return o[key]
end

View file

@ -57,6 +57,17 @@ class TestConfigFile < Test::Unit::TestCase
assert_equal 'bin/rails server', conf.options[:restart_cmd]
end
def test_overwrite_options
conf = Puma::Configuration.new do |c|
c.workers 3
end
conf.load
assert_equal conf.options[:workers], 3
conf.options[:workers] += 1
assert_equal conf.options[:workers], 4
end
private
def with_env(env = {})