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
Comment on lines +66 to +68
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion arguments are in the wrong order. The expected value should come first, followed by the actual value. Change to assert_equal 3, conf.options[:workers].

Suggested change
assert_equal conf.options[:workers], 3
conf.options[:workers] += 1
assert_equal conf.options[:workers], 4
assert_equal 3, conf.options[:workers]
conf.options[:workers] += 1
assert_equal 4, conf.options[:workers]

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +68
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion arguments are in the wrong order. The expected value should come first, followed by the actual value. Change to assert_equal 4, conf.options[:workers].

Suggested change
assert_equal conf.options[:workers], 3
conf.options[:workers] += 1
assert_equal conf.options[:workers], 4
assert_equal 3, conf.options[:workers]
conf.options[:workers] += 1
assert_equal 4, conf.options[:workers]

Copilot uses AI. Check for mistakes.
end

private

def with_env(env = {})
Expand Down