2 require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
3 require 'rubygems/commands/server_command'
5 class TestGemCommandsServerCommand < RubyGemTestCase
10 @cmd = Gem::Commands::ServerCommand.new
13 def test_handle_options
14 @cmd.send :handle_options, %w[-p 8808 --no-daemon]
16 assert_equal false, @cmd.options[:daemon]
17 assert_equal @gemhome, @cmd.options[:gemdir]
18 assert_equal 8808, @cmd.options[:port]
20 @cmd.send :handle_options, %w[-p 9999 -d /nonexistent --daemon]
22 assert_equal true, @cmd.options[:daemon]
23 assert_equal File.expand_path('/nonexistent'), @cmd.options[:gemdir]
24 assert_equal 9999, @cmd.options[:port]