Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/puma/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def shift
end

def [](key)
@set.each do |o|
@set.reverse_each do |o|
if o.key? key
return o[key]
end
Expand Down
11 changes: 11 additions & 0 deletions test/test_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ def test_allow_users_to_override_default_options
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 = {})
Expand Down