rubygems-update 1.4.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

Files changed (150) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.autotest +4 -5
  3. data/{test/foo/discover.rb → .gemtest} +0 -0
  4. data/ChangeLog +13 -0
  5. data/History.txt +35 -1
  6. data/Manifest.txt +89 -88
  7. data/README.rdoc +21 -10
  8. data/Rakefile +31 -17
  9. data/UPGRADING.rdoc +81 -0
  10. data/ci_build.sh +27 -0
  11. data/cruise_config.rb +20 -13
  12. data/lib/rbconfig/datadir.rb +1 -1
  13. data/lib/rubygems.rb +102 -45
  14. data/lib/rubygems/builder.rb +5 -11
  15. data/lib/rubygems/command_manager.rb +0 -1
  16. data/lib/rubygems/commands/check_command.rb +2 -17
  17. data/lib/rubygems/commands/cleanup_command.rb +1 -1
  18. data/lib/rubygems/commands/dependency_command.rb +5 -18
  19. data/lib/rubygems/commands/environment_command.rb +5 -4
  20. data/lib/rubygems/commands/fetch_command.rb +0 -1
  21. data/lib/rubygems/commands/generate_index_command.rb +1 -10
  22. data/lib/rubygems/commands/help_command.rb +0 -5
  23. data/lib/rubygems/commands/query_command.rb +4 -24
  24. data/lib/rubygems/commands/setup_command.rb +4 -19
  25. data/lib/rubygems/commands/sources_command.rb +15 -37
  26. data/lib/rubygems/commands/specification_command.rb +1 -2
  27. data/lib/rubygems/commands/unpack_command.rb +19 -7
  28. data/lib/rubygems/commands/update_command.rb +29 -44
  29. data/lib/rubygems/config_file.rb +25 -19
  30. data/lib/rubygems/custom_require.rb +4 -6
  31. data/lib/rubygems/dependency.rb +1 -43
  32. data/lib/rubygems/dependency_installer.rb +1 -1
  33. data/lib/rubygems/doc_manager.rb +3 -1
  34. data/lib/rubygems/ext/builder.rb +3 -1
  35. data/lib/rubygems/ext/rake_builder.rb +10 -2
  36. data/lib/rubygems/format.rb +7 -4
  37. data/lib/rubygems/gem_runner.rb +1 -1
  38. data/lib/rubygems/indexer.rb +11 -74
  39. data/lib/rubygems/install_update_options.rb +13 -8
  40. data/lib/rubygems/installer.rb +139 -95
  41. data/{test/gem_installer_test_case.rb → lib/rubygems/installer_test_case.rb} +41 -2
  42. data/{test/mockgemui.rb → lib/rubygems/mock_gem_ui.rb} +8 -1
  43. data/lib/rubygems/old_format.rb +2 -1
  44. data/lib/rubygems/package.rb +17 -2
  45. data/lib/rubygems/package/tar_input.rb +7 -3
  46. data/lib/rubygems/package/tar_output.rb +2 -0
  47. data/lib/rubygems/package/tar_reader/entry.rb +4 -0
  48. data/{test/gem_package_tar_test_case.rb → lib/rubygems/package/tar_test_case.rb} +5 -2
  49. data/lib/rubygems/package_task.rb +6 -4
  50. data/lib/rubygems/remote_fetcher.rb +10 -2
  51. data/lib/rubygems/require_paths_builder.rb +2 -1
  52. data/lib/rubygems/server.rb +3 -44
  53. data/lib/rubygems/source_index.rb +3 -216
  54. data/lib/rubygems/spec_fetcher.rb +15 -63
  55. data/lib/rubygems/specification.rb +1 -1
  56. data/{test/gemutilities.rb → lib/rubygems/test_case.rb} +219 -90
  57. data/lib/rubygems/test_utilities.rb +7 -20
  58. data/lib/rubygems/uninstaller.rb +27 -28
  59. data/lib/rubygems/user_interaction.rb +81 -42
  60. data/lib/rubygems/validator.rb +0 -73
  61. data/test/{bogussources.rb → rubygems/bogussources.rb} +0 -0
  62. data/test/{data → rubygems/data}/gem-private_key.pem +0 -0
  63. data/test/{data → rubygems/data}/gem-public_cert.pem +0 -0
  64. data/test/{fake_certlib → rubygems/fake_certlib}/openssl.rb +0 -0
  65. data/test/rubygems/foo/discover.rb +0 -0
  66. data/test/{functional.rb → rubygems/functional.rb} +0 -0
  67. data/test/{insure_session.rb → rubygems/insure_session.rb} +0 -0
  68. data/test/{plugin → rubygems/plugin}/exception/rubygems_plugin.rb +0 -0
  69. data/test/{plugin → rubygems/plugin}/load/rubygems_plugin.rb +0 -0
  70. data/test/{plugin → rubygems/plugin}/standarderror/rubygems_plugin.rb +0 -0
  71. data/test/{private_key.pem → rubygems/private_key.pem} +0 -0
  72. data/test/{public_cert.pem → rubygems/public_cert.pem} +0 -0
  73. data/test/rubygems/{commands → rubygems/commands}/crash_command.rb +0 -0
  74. data/test/{rubygems_plugin.rb → rubygems/rubygems_plugin.rb} +0 -0
  75. data/test/rubygems/sff/discover.rb +0 -0
  76. data/test/{simple_gem.rb → rubygems/simple_gem.rb} +2 -2
  77. data/test/{test_config.rb → rubygems/test_config.rb} +2 -2
  78. data/test/{test_gem.rb → rubygems/test_gem.rb} +12 -2
  79. data/test/{test_gem_builder.rb → rubygems/test_gem_builder.rb} +2 -2
  80. data/test/{test_gem_command.rb → rubygems/test_gem_command.rb} +3 -3
  81. data/test/{test_gem_command_manager.rb → rubygems/test_gem_command_manager.rb} +15 -6
  82. data/test/{test_gem_commands_build_command.rb → rubygems/test_gem_commands_build_command.rb} +2 -2
  83. data/test/{test_gem_commands_cert_command.rb → rubygems/test_gem_commands_cert_command.rb} +2 -2
  84. data/test/{test_gem_commands_check_command.rb → rubygems/test_gem_commands_check_command.rb} +2 -2
  85. data/test/{test_gem_commands_contents_command.rb → rubygems/test_gem_commands_contents_command.rb} +3 -3
  86. data/test/{test_gem_commands_dependency_command.rb → rubygems/test_gem_commands_dependency_command.rb} +4 -4
  87. data/test/{test_gem_commands_environment_command.rb → rubygems/test_gem_commands_environment_command.rb} +12 -3
  88. data/test/{test_gem_commands_fetch_command.rb → rubygems/test_gem_commands_fetch_command.rb} +2 -2
  89. data/test/{test_gem_commands_generate_index_command.rb → rubygems/test_gem_commands_generate_index_command.rb} +7 -11
  90. data/test/{test_gem_commands_install_command.rb → rubygems/test_gem_commands_install_command.rb} +2 -2
  91. data/test/{test_gem_commands_list_command.rb → rubygems/test_gem_commands_list_command.rb} +2 -2
  92. data/test/{test_gem_commands_lock_command.rb → rubygems/test_gem_commands_lock_command.rb} +2 -2
  93. data/test/{test_gem_commands_outdated_command.rb → rubygems/test_gem_commands_outdated_command.rb} +2 -2
  94. data/test/{test_gem_commands_owner_command.rb → rubygems/test_gem_commands_owner_command.rb} +5 -5
  95. data/test/{test_gem_commands_pristine_command.rb → rubygems/test_gem_commands_pristine_command.rb} +2 -2
  96. data/test/{test_gem_commands_push_command.rb → rubygems/test_gem_commands_push_command.rb} +3 -3
  97. data/test/{test_gem_commands_query_command.rb → rubygems/test_gem_commands_query_command.rb} +2 -2
  98. data/test/{test_gem_commands_server_command.rb → rubygems/test_gem_commands_server_command.rb} +2 -2
  99. data/test/{test_gem_commands_sources_command.rb → rubygems/test_gem_commands_sources_command.rb} +8 -8
  100. data/test/{test_gem_commands_specification_command.rb → rubygems/test_gem_commands_specification_command.rb} +3 -3
  101. data/test/{test_gem_commands_stale_command.rb → rubygems/test_gem_commands_stale_command.rb} +2 -2
  102. data/test/{test_gem_commands_uninstall_command.rb → rubygems/test_gem_commands_uninstall_command.rb} +16 -10
  103. data/test/{test_gem_commands_unpack_command.rb → rubygems/test_gem_commands_unpack_command.rb} +42 -2
  104. data/test/{test_gem_commands_update_command.rb → rubygems/test_gem_commands_update_command.rb} +2 -2
  105. data/test/{test_gem_commands_which_command.rb → rubygems/test_gem_commands_which_command.rb} +3 -3
  106. data/test/{test_gem_config_file.rb → rubygems/test_gem_config_file.rb} +2 -2
  107. data/test/{test_gem_dependency.rb → rubygems/test_gem_dependency.rb} +3 -27
  108. data/test/{test_gem_dependency_installer.rb → rubygems/test_gem_dependency_installer.rb} +2 -2
  109. data/test/{test_gem_dependency_list.rb → rubygems/test_gem_dependency_list.rb} +3 -3
  110. data/test/{test_gem_doc_manager.rb → rubygems/test_gem_doc_manager.rb} +2 -2
  111. data/test/{test_gem_ext_configure_builder.rb → rubygems/test_gem_ext_configure_builder.rb} +4 -4
  112. data/test/{test_gem_ext_ext_conf_builder.rb → rubygems/test_gem_ext_ext_conf_builder.rb} +46 -2
  113. data/test/{test_gem_ext_rake_builder.rb → rubygems/test_gem_ext_rake_builder.rb} +2 -2
  114. data/test/{test_gem_format.rb → rubygems/test_gem_format.rb} +24 -6
  115. data/test/{test_gem_gem_path_searcher.rb → rubygems/test_gem_gem_path_searcher.rb} +2 -2
  116. data/test/{test_gem_gem_runner.rb → rubygems/test_gem_gem_runner.rb} +2 -2
  117. data/test/{test_gem_gemcutter_utilities.rb → rubygems/test_gem_gemcutter_utilities.rb} +4 -4
  118. data/test/{test_gem_indexer.rb → rubygems/test_gem_indexer.rb} +4 -121
  119. data/test/{test_gem_install_update_options.rb → rubygems/test_gem_install_update_options.rb} +3 -3
  120. data/test/{test_gem_installer.rb → rubygems/test_gem_installer.rb} +106 -13
  121. data/test/{test_gem_local_remote_options.rb → rubygems/test_gem_local_remote_options.rb} +2 -2
  122. data/test/{test_gem_package_tar_header.rb → rubygems/test_gem_package_tar_header.rb} +2 -2
  123. data/test/{test_gem_package_tar_input.rb → rubygems/test_gem_package_tar_input.rb} +21 -4
  124. data/test/{test_gem_package_tar_output.rb → rubygems/test_gem_package_tar_output.rb} +2 -2
  125. data/test/{test_gem_package_tar_reader.rb → rubygems/test_gem_package_tar_reader.rb} +2 -2
  126. data/test/{test_gem_package_tar_reader_entry.rb → rubygems/test_gem_package_tar_reader_entry.rb} +12 -2
  127. data/test/{test_gem_package_tar_writer.rb → rubygems/test_gem_package_tar_writer.rb} +2 -2
  128. data/test/{test_gem_package_task.rb → rubygems/test_gem_package_task.rb} +15 -2
  129. data/test/{test_gem_platform.rb → rubygems/test_gem_platform.rb} +2 -2
  130. data/test/{test_gem_remote_fetcher.rb → rubygems/test_gem_remote_fetcher.rb} +7 -7
  131. data/test/{test_gem_requirement.rb → rubygems/test_gem_requirement.rb} +2 -2
  132. data/test/{test_gem_security.rb → rubygems/test_gem_security.rb} +3 -4
  133. data/test/{test_gem_server.rb → rubygems/test_gem_server.rb} +2 -132
  134. data/test/rubygems/test_gem_silent_ui.rb +113 -0
  135. data/test/{test_gem_source_index.rb → rubygems/test_gem_source_index.rb} +2 -61
  136. data/test/{test_gem_spec_fetcher.rb → rubygems/test_gem_spec_fetcher.rb} +2 -2
  137. data/test/{test_gem_specification.rb → rubygems/test_gem_specification.rb} +4 -4
  138. data/test/{test_gem_stream_ui.rb → rubygems/test_gem_stream_ui.rb} +24 -2
  139. data/test/{test_gem_text.rb → rubygems/test_gem_text.rb} +2 -2
  140. data/test/{test_gem_uninstaller.rb → rubygems/test_gem_uninstaller.rb} +15 -12
  141. data/test/{test_gem_validator.rb → rubygems/test_gem_validator.rb} +3 -3
  142. data/test/{test_gem_version.rb → rubygems/test_gem_version.rb} +2 -2
  143. data/test/{test_gem_version_option.rb → rubygems/test_gem_version_option.rb} +2 -2
  144. data/test/{test_kernel.rb → rubygems/test_kernel.rb} +7 -10
  145. metadata +281 -177
  146. metadata.gz.sig +0 -0
  147. data/lib/rubygems/commands/mirror_command.rb +0 -111
  148. data/lib/rubygems/source_info_cache.rb +0 -394
  149. data/lib/rubygems/source_info_cache_entry.rb +0 -56
  150. data/test/test_gem_commands_mirror_command.rb +0 -60
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/builder'
3
3
 
4
- class TestGemBuilder < RubyGemTestCase
4
+ class TestGemBuilder < Gem::TestCase
5
5
 
6
6
  def test_build
7
7
  builder = Gem::Builder.new quick_gem('a')
@@ -1,11 +1,11 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/command'
3
3
 
4
4
  class Gem::Command
5
5
  public :parser
6
6
  end
7
7
 
8
- class TestGemCommand < RubyGemTestCase
8
+ class TestGemCommand < Gem::TestCase
9
9
 
10
10
  def setup
11
11
  super
@@ -87,7 +87,7 @@ class TestGemCommand < RubyGemTestCase
87
87
  assert done
88
88
  end
89
89
 
90
- def test_invode_with_bad_options
90
+ def test_invoke_with_bad_options
91
91
  use_ui @ui do
92
92
  @cmd.when_invoked do true end
93
93
 
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/command_manager'
3
3
 
4
- class TestGemCommandManager < RubyGemTestCase
4
+ class TestGemCommandManager < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -10,34 +10,43 @@ class TestGemCommandManager < RubyGemTestCase
10
10
  end
11
11
 
12
12
  def test_run_interrupt
13
+ old_load_path = $:.dup
14
+ $: << "test/rubygems"
13
15
  Gem.load_env_plugins
14
16
 
15
17
  use_ui @ui do
16
- assert_raises MockGemUi::TermError do
18
+ assert_raises Gem::MockGemUi::TermError do
17
19
  @command_manager.run 'interrupt'
18
20
  end
19
21
  assert_equal '', ui.output
20
22
  assert_equal "ERROR: Interrupted\n", ui.error
21
23
  end
24
+ ensure
25
+ $:.replace old_load_path
22
26
  end
23
27
 
24
28
  def test_run_crash_command
29
+ old_load_path = $:.dup
30
+ $: << "test/rubygems"
31
+
25
32
  @command_manager.register_command :crash
26
33
  use_ui @ui do
27
- assert_raises MockGemUi::TermError do
34
+ assert_raises Gem::MockGemUi::TermError do
28
35
  @command_manager.run 'crash'
29
36
  end
30
37
  assert_equal '', ui.output
31
38
  err = ui.error.split("\n").first
32
39
  assert_equal "ERROR: Loading command: crash (RuntimeError)", err
33
40
  end
41
+ ensure
42
+ $:.replace old_load_path
34
43
  end
35
44
 
36
45
  def test_process_args_bad_arg
37
46
  use_ui @ui do
38
- assert_raises(MockGemUi::TermError) {
47
+ assert_raises Gem::MockGemUi::TermError do
39
48
  @command_manager.process_args("--bad-arg")
40
- }
49
+ end
41
50
  end
42
51
 
43
52
  assert_match(/invalid option: --bad-arg/i, @ui.error)
@@ -1,8 +1,8 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/build_command'
3
3
  require 'rubygems/format'
4
4
 
5
- class TestGemCommandsBuildCommand < RubyGemTestCase
5
+ class TestGemCommandsBuildCommand < Gem::TestCase
6
6
 
7
7
  def setup
8
8
  super
@@ -1,11 +1,11 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/cert_command'
3
3
 
4
4
  unless defined? OpenSSL then
5
5
  warn "`gem cert` tests are being skipped, module OpenSSL not found"
6
6
  end
7
7
 
8
- class TestGemCommandsCertCommand < RubyGemTestCase
8
+ class TestGemCommandsCertCommand < Gem::TestCase
9
9
 
10
10
  def setup
11
11
  super
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/check_command'
3
3
 
4
- class TestGemCommandsCheckCommand < RubyGemTestCase
4
+ class TestGemCommandsCheckCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/contents_command'
3
3
 
4
- class TestGemCommandsContentsCommand < RubyGemTestCase
4
+ class TestGemCommandsContentsCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -48,7 +48,7 @@ class TestGemCommandsContentsCommand < RubyGemTestCase
48
48
  def test_execute_bad_gem
49
49
  @cmd.options[:args] = %w[foo]
50
50
 
51
- assert_raises MockGemUi::TermError do
51
+ assert_raises Gem::MockGemUi::TermError do
52
52
  use_ui @ui do
53
53
  @cmd.execute
54
54
  end
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/dependency_command'
3
3
 
4
- class TestGemCommandsDependencyCommand < RubyGemTestCase
4
+ class TestGemCommandsDependencyCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -66,7 +66,7 @@ Gem pl-1-x86-linux
66
66
  def test_execute_no_match
67
67
  @cmd.options[:args] = %w[foo]
68
68
 
69
- assert_raises MockGemUi::TermError do
69
+ assert_raises Gem::MockGemUi::TermError do
70
70
  use_ui @ui do
71
71
  @cmd.execute
72
72
  end
@@ -155,7 +155,7 @@ Gem foo-2
155
155
  @cmd.options[:reverse_dependencies] = true
156
156
  @cmd.options[:domain] = :remote
157
157
 
158
- assert_raises MockGemUi::TermError do
158
+ assert_raises Gem::MockGemUi::TermError do
159
159
  use_ui @ui do
160
160
  @cmd.execute
161
161
  end
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/environment_command'
3
3
 
4
- class TestGemCommandsEnvironmentCommand < RubyGemTestCase
4
+ class TestGemCommandsEnvironmentCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -131,5 +131,14 @@ class TestGemCommandsEnvironmentCommand < RubyGemTestCase
131
131
  assert_equal '', @ui.error
132
132
  end
133
133
 
134
- end
134
+ def test_execute_platform
135
+ @cmd.send :handle_options, %w[platform]
136
+
137
+ use_ui @ui do
138
+ @cmd.execute
139
+ end
135
140
 
141
+ assert_equal "#{Gem.platforms.join File::PATH_SEPARATOR}\n", @ui.output
142
+ assert_equal '', @ui.error
143
+ end
144
+ end
@@ -1,9 +1,9 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/package'
3
3
  require 'rubygems/security'
4
4
  require 'rubygems/commands/fetch_command'
5
5
 
6
- class TestGemCommandsFetchCommand < RubyGemTestCase
6
+ class TestGemCommandsFetchCommand < Gem::TestCase
7
7
 
8
8
  def setup
9
9
  super
@@ -1,8 +1,8 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/indexer'
3
3
  require 'rubygems/commands/generate_index_command'
4
4
 
5
- class TestGemCommandsGenerateIndexCommand < RubyGemTestCase
5
+ class TestGemCommandsGenerateIndexCommand < Gem::TestCase
6
6
 
7
7
  def setup
8
8
  super
@@ -16,15 +16,11 @@ class TestGemCommandsGenerateIndexCommand < RubyGemTestCase
16
16
  @cmd.execute
17
17
  end
18
18
 
19
- yaml = File.join @gemhome, 'yaml'
20
- yaml_z = File.join @gemhome, 'yaml.Z'
21
- quick_index = File.join @gemhome, 'quick', 'index'
22
- quick_index_rz = File.join @gemhome, 'quick', 'index.rz'
19
+ marshal = File.join @gemhome, 'Marshal.4.8'
20
+ marshal_z = File.join @gemhome, 'Marshal.4.8.Z'
23
21
 
24
- assert File.exist?(yaml), yaml
25
- assert File.exist?(yaml_z), yaml_z
26
- assert File.exist?(quick_index), quick_index
27
- assert File.exist?(quick_index_rz), quick_index_rz
22
+ assert File.exist?(marshal), marshal
23
+ assert File.exist?(marshal_z), marshal_z
28
24
  end
29
25
 
30
26
  def test_execute_rss_update
@@ -33,7 +29,7 @@ class TestGemCommandsGenerateIndexCommand < RubyGemTestCase
33
29
  @cmd.options[:rss_gems_host] = 'gems.example.com'
34
30
 
35
31
  use_ui @ui do
36
- assert_raises MockGemUi::TermError do
32
+ assert_raises Gem::MockGemUi::TermError do
37
33
  @cmd.execute
38
34
  end
39
35
  end
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/install_command'
3
3
 
4
- class TestGemCommandsInstallCommand < RubyGemTestCase
4
+ class TestGemCommandsInstallCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/list_command'
3
3
 
4
- class TestGemCommandsListCommand < RubyGemTestCase
4
+ class TestGemCommandsListCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/lock_command'
3
3
 
4
- class TestGemCommandsLockCommand < RubyGemTestCase
4
+ class TestGemCommandsLockCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/outdated_command'
3
3
 
4
- class TestGemCommandsOutdatedCommand < RubyGemTestCase
4
+ class TestGemCommandsOutdatedCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/owner_command'
3
3
 
4
- class TestGemCommandsOwnerCommand < RubyGemTestCase
4
+ class TestGemCommandsOwnerCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -38,7 +38,7 @@ EOF
38
38
  response = "You don't have permission to push to this gem"
39
39
  @fetcher.data["#{Gem.host}/api/v1/gems/freewill/owners.yaml"] = [response, 403, 'Forbidden']
40
40
 
41
- assert_raises MockGemUi::TermError do
41
+ assert_raises Gem::MockGemUi::TermError do
42
42
  use_ui @ui do
43
43
  @cmd.show_owners("freewill")
44
44
  end
@@ -66,7 +66,7 @@ EOF
66
66
  response = "You don't have permission to push to this gem"
67
67
  @fetcher.data["#{Gem.host}/api/v1/gems/freewill/owners"] = [response, 403, 'Forbidden']
68
68
 
69
- assert_raises MockGemUi::TermError do
69
+ assert_raises Gem::MockGemUi::TermError do
70
70
  use_ui @ui do
71
71
  @cmd.add_owners("freewill", ["user-new1@example.com"])
72
72
  end
@@ -94,7 +94,7 @@ EOF
94
94
  response = "You don't have permission to push to this gem"
95
95
  @fetcher.data["#{Gem.host}/api/v1/gems/freewill/owners"] = [response, 403, 'Forbidden']
96
96
 
97
- assert_raises MockGemUi::TermError do
97
+ assert_raises Gem::MockGemUi::TermError do
98
98
  use_ui @ui do
99
99
  @cmd.remove_owners("freewill", ["user-remove1@example.com"])
100
100
  end
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/pristine_command'
3
3
 
4
- class TestGemCommandsPristineCommand < RubyGemTestCase
4
+ class TestGemCommandsPristineCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/push_command'
3
3
 
4
- class TestGemCommandsPushCommand < RubyGemTestCase
4
+ class TestGemCommandsPushCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -68,7 +68,7 @@ class TestGemCommandsPushCommand < RubyGemTestCase
68
68
  response = "You don't have permission to push to this gem"
69
69
  @fetcher.data["#{Gem.host}/api/v1/gems"] = [response, 403, 'Forbidden']
70
70
 
71
- assert_raises MockGemUi::TermError do
71
+ assert_raises Gem::MockGemUi::TermError do
72
72
  use_ui @ui do
73
73
  @cmd.send_gem(@path)
74
74
  end
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/query_command'
3
3
 
4
- class TestGemCommandsQueryCommand < RubyGemTestCase
4
+ class TestGemCommandsQueryCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/server_command'
3
3
 
4
- class TestGemCommandsServerCommand < RubyGemTestCase
4
+ class TestGemCommandsServerCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/sources_command'
3
3
 
4
- class TestGemCommandsSourcesCommand < RubyGemTestCase
4
+ class TestGemCommandsSourcesCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -84,7 +84,9 @@ class TestGemCommandsSourcesCommand < RubyGemTestCase
84
84
  util_setup_spec_fetcher
85
85
 
86
86
  use_ui @ui do
87
- @cmd.execute
87
+ assert_raises Gem::MockGemUi::TermError do
88
+ @cmd.execute
89
+ end
88
90
  end
89
91
 
90
92
  expected = <<-EOF
@@ -102,7 +104,9 @@ Error fetching http://beta-gems.example.com:
102
104
  util_setup_spec_fetcher
103
105
 
104
106
  use_ui @ui do
105
- @cmd.execute
107
+ assert_raises Gem::MockGemUi::TermError do
108
+ @cmd.execute
109
+ end
106
110
  end
107
111
 
108
112
  assert_equal [@gem_repo], Gem.sources
@@ -131,10 +135,6 @@ beta-gems.example.com is not a URI
131
135
 
132
136
  expected = <<-EOF
133
137
  *** Removed specs cache ***
134
- *** Removed user source cache ***
135
- *** Removed latest user source cache ***
136
- *** Removed system source cache ***
137
- *** Removed latest system source cache ***
138
138
  EOF
139
139
 
140
140
  assert_equal expected, @ui.output
@@ -1,7 +1,7 @@
1
- require File.expand_path('../gemutilities', __FILE__)
1
+ require 'rubygems/test_case'
2
2
  require 'rubygems/commands/specification_command'
3
3
 
4
- class TestGemCommandsSpecificationCommand < RubyGemTestCase
4
+ class TestGemCommandsSpecificationCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
  super
@@ -45,7 +45,7 @@ class TestGemCommandsSpecificationCommand < RubyGemTestCase
45
45
  def test_execute_bad_name
46
46
  @cmd.options[:args] = %w[foo]
47
47
 
48
- assert_raises MockGemUi::TermError do
48
+ assert_raises Gem::MockGemUi::TermError do
49
49
  use_ui @ui do
50
50
  @cmd.execute
51
51
  end