HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.5.9/test/webrick/test_config.rb
# frozen_string_literal: false
require "test/unit"
require "webrick/config"

class TestWEBrickConfig < Test::Unit::TestCase
  def test_server_name_default
    config = WEBrick::Config::General.dup
    assert_equal(false, config.key?(:ServerName))
    assert_equal(WEBrick::Utils.getservername, config[:ServerName])
    assert_equal(true, config.key?(:ServerName))
  end

  def test_server_name_set_nil
    config = WEBrick::Config::General.dup.update(ServerName: nil)
    assert_equal(nil, config[:ServerName])
  end
end