aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_generate_index_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 06:52:18 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 06:52:18 +0000
commit9694bb8cac12969300692dac5a1cf7aa4e3a46cd (patch)
treec3cb423d701f7049ba9382de052e2a937cd1302d /test/rubygems/test_gem_commands_generate_index_command.rb
parent3f606b7063fc7a8b191556365ad343a314719a8d (diff)
downloadruby-9694bb8cac12969300692dac5a1cf7aa4e3a46cd.tar.gz
* lib/rubygems*: Updated to RubyGems 2.0
* test/rubygems*: ditto. * common.mk (prelude): Updated for RubyGems 2.0 source rearrangement. * tool/change_maker.rb: Allow invalid UTF-8 characters in source files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_generate_index_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_generate_index_command.rb85
1 files changed, 2 insertions, 83 deletions
diff --git a/test/rubygems/test_gem_commands_generate_index_command.rb b/test/rubygems/test_gem_commands_generate_index_command.rb
index ee4cd8051e..2e478d9c9e 100644
--- a/test/rubygems/test_gem_commands_generate_index_command.rb
+++ b/test/rubygems/test_gem_commands_generate_index_command.rb
@@ -16,27 +16,9 @@ class TestGemCommandsGenerateIndexCommand < Gem::TestCase
@cmd.execute
end
- marshal = File.join @gemhome, 'Marshal.4.8'
- marshal_z = File.join @gemhome, 'Marshal.4.8.Z'
+ specs = File.join @gemhome, "specs.4.8.gz"
- assert File.exist?(marshal), marshal
- assert File.exist?(marshal_z), marshal_z
- end
-
- def test_execute_rss_update
- @cmd.options[:update] = true
- @cmd.options[:rss_host] = 'example.com'
- @cmd.options[:rss_gems_host] = 'gems.example.com'
-
- use_ui @ui do
- assert_raises Gem::MockGemUi::TermError do
- @cmd.execute
- end
- end
-
- assert_equal "ERROR: --update not compatible with RSS generation\n",
- @ui.error
- assert_empty @ui.output
+ assert File.exist?(specs), specs
end
def test_handle_options_directory
@@ -58,69 +40,6 @@ class TestGemCommandsGenerateIndexCommand < Gem::TestCase
assert_equal 'C:/nonexistent', @cmd.options[:directory]
end
- def test_handle_options_invalid
- e = assert_raises OptionParser::InvalidOption do
- @cmd.handle_options %w[--no-modern --no-legacy]
- end
-
- assert_equal 'invalid option: --no-legacy no indicies will be built',
- e.message
-
- @cmd = Gem::Commands::GenerateIndexCommand.new
- e = assert_raises OptionParser::InvalidOption do
- @cmd.handle_options %w[--no-legacy --no-modern]
- end
-
- assert_equal 'invalid option: --no-modern no indicies will be built',
- e.message
- end
-
- def test_handle_options_legacy
- @cmd.handle_options %w[--legacy]
-
- assert @cmd.options[:build_legacy]
- assert @cmd.options[:build_modern], ':build_modern not set'
- end
-
- def test_handle_options_modern
- @cmd.handle_options %w[--modern]
-
- assert @cmd.options[:build_legacy]
- assert @cmd.options[:build_modern], ':build_modern not set'
- end
-
- def test_handle_options_no_legacy
- @cmd.handle_options %w[--no-legacy]
-
- refute @cmd.options[:build_legacy]
- assert @cmd.options[:build_modern]
- end
-
- def test_handle_options_no_modern
- @cmd.handle_options %w[--no-modern]
-
- assert @cmd.options[:build_legacy]
- refute @cmd.options[:build_modern]
- end
-
- def test_handle_options_rss_gems_host
- @cmd.handle_options %w[--rss-gems-host gems.example.com]
-
- assert_equal 'gems.example.com', @cmd.options[:rss_gems_host]
- end
-
- def test_handle_options_rss_host
- @cmd.handle_options %w[--rss-host example.com]
-
- assert_equal 'example.com', @cmd.options[:rss_host]
- end
-
- def test_handle_options_rss_title
- @cmd.handle_options %w[--rss-title Example\ Gems]
-
- assert_equal 'Example Gems', @cmd.options[:rss_title]
- end
-
def test_handle_options_update
@cmd.handle_options %w[--update]