Sha256: a395dc744de5ba8efbb01d74423ee075241ffd8ff8b0f3686bcb431c69c3d5fe

Contents?: true

Size: 710 Bytes

Versions: 2

Compression:

Stored size: 710 Bytes

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
rubygems-update-1.3.1 test/test_gem_commands_server_command.rb
rubygems-update-1.3.2 test/test_gem_commands_server_command.rb