Sha256: d370bc29c52ecebbc8f2c870aa27c63067f62e3ffbd7a3cb4f90ea7df4546813

Contents?: true

Size: 712 Bytes

Versions: 2

Compression:

Stored size: 712 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 '/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.0.0 test/test_gem_commands_server_command.rb
rubygems-update-1.0.1 test/test_gem_commands_server_command.rb