diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-10 07:48:56 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-10 07:48:56 +0000 |
commit | fbf59bdbea63efd34ccc144e648467d2f52e7345 (patch) | |
tree | 244f0e7ae112cc7dd135e5d1ac24e6c70ba71b4a /test/rubygems/test_gem_install_update_options.rb | |
parent | 7a4aad75356496559460041a6c063bdb736c7236 (diff) | |
download | ruby-fbf59bdbea63efd34ccc144e648467d2f52e7345.tar.gz |
Import RubyGems trunk revision 1493.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_install_update_options.rb')
-rw-r--r-- | test/rubygems/test_gem_install_update_options.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_install_update_options.rb b/test/rubygems/test_gem_install_update_options.rb new file mode 100644 index 0000000000..dafdf65920 --- /dev/null +++ b/test/rubygems/test_gem_install_update_options.rb @@ -0,0 +1,40 @@ +require 'test/unit' +require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities') +require 'rubygems/install_update_options' +require 'rubygems/command' + +class TestGemInstallUpdateOptions < RubyGemTestCase + + def setup + super + + @cmd = Gem::Command.new 'dummy', 'dummy' + @cmd.extend Gem::InstallUpdateOptions + end + + def test_add_install_update_options + @cmd.add_install_update_options + + args = %w[-i /install_to --rdoc --ri -E -f -t -w -P HighSecurity + --ignore-dependencies --include-dependencies] + + assert @cmd.handles?(args) + end + + def test_security_policy + @cmd.add_install_update_options + + @cmd.handle_options %w[-P HighSecurity] + + assert_equal Gem::Security::HighSecurity, @cmd.options[:security_policy] + end + + def test_security_policy_unknown + @cmd.add_install_update_options + + assert_raise OptionParser::InvalidArgument do + @cmd.handle_options %w[-P UnknownSecurity] + end + end + +end |