Sha256: 26cc40605d1fc9a0d59f6bab3b78e26b8da0fd653c71f2d89c75152bcce59ef8

Contents?: true

Size: 730 Bytes

Versions: 4

Compression:

Stored size: 730 Bytes

Contents

require 'test/unit'
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
require 'rubygems/commands/server_command'

class TestGemCommandsServerCommand < RubyGemTestCase

  def setup
    super

    @cmd = Gem::Commands::ServerCommand.new
  end

  def test_handle_options
    @cmd.send :handle_options, %w[-p 8808 --no-daemon]

    assert_equal false, @cmd.options[:daemon]
    assert_equal @gemhome, @cmd.options[:gemdir]
    assert_equal 8808, @cmd.options[:port]

    @cmd.send :handle_options, %w[-p 9999 -d /nonexistent --daemon]

    assert_equal true, @cmd.options[:daemon]
    assert_equal File.expand_path('/nonexistent'), @cmd.options[:gemdir]
    assert_equal 9999, @cmd.options[:port]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubygems-update-1.1.0 test/test_gem_commands_server_command.rb
rubygems-update-1.1.1 test/test_gem_commands_server_command.rb
rubygems-update-1.3.0 test/test_gem_commands_server_command.rb
rubygems-update-1.2.0 test/test_gem_commands_server_command.rb