2 require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
3 require 'rubygems/install_update_options'
4 require 'rubygems/command'
6 class TestGemInstallUpdateOptions < RubyGemTestCase
11 @cmd = Gem::Command.new 'dummy', 'dummy'
12 @cmd.extend Gem::InstallUpdateOptions
15 def test_add_install_update_options
16 @cmd.add_install_update_options
18 args = %w[-i /install_to --rdoc --ri -E -f -t -w -P HighSecurity
19 --ignore-dependencies --format-exec --include-dependencies]
21 assert @cmd.handles?(args)
24 def test_security_policy
25 @cmd.add_install_update_options
27 @cmd.handle_options %w[-P HighSecurity]
29 assert_equal Gem::Security::HighSecurity, @cmd.options[:security_policy]
32 def test_security_policy_unknown
33 @cmd.add_install_update_options
35 assert_raise OptionParser::InvalidArgument do
36 @cmd.handle_options %w[-P UnknownSecurity]