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.
- data.tar.gz.sig +0 -0
- data/.autotest +4 -5
- data/{test/foo/discover.rb → .gemtest} +0 -0
- data/ChangeLog +13 -0
- data/History.txt +35 -1
- data/Manifest.txt +89 -88
- data/README.rdoc +21 -10
- data/Rakefile +31 -17
- data/UPGRADING.rdoc +81 -0
- data/ci_build.sh +27 -0
- data/cruise_config.rb +20 -13
- data/lib/rbconfig/datadir.rb +1 -1
- data/lib/rubygems.rb +102 -45
- data/lib/rubygems/builder.rb +5 -11
- data/lib/rubygems/command_manager.rb +0 -1
- data/lib/rubygems/commands/check_command.rb +2 -17
- data/lib/rubygems/commands/cleanup_command.rb +1 -1
- data/lib/rubygems/commands/dependency_command.rb +5 -18
- data/lib/rubygems/commands/environment_command.rb +5 -4
- data/lib/rubygems/commands/fetch_command.rb +0 -1
- data/lib/rubygems/commands/generate_index_command.rb +1 -10
- data/lib/rubygems/commands/help_command.rb +0 -5
- data/lib/rubygems/commands/query_command.rb +4 -24
- data/lib/rubygems/commands/setup_command.rb +4 -19
- data/lib/rubygems/commands/sources_command.rb +15 -37
- data/lib/rubygems/commands/specification_command.rb +1 -2
- data/lib/rubygems/commands/unpack_command.rb +19 -7
- data/lib/rubygems/commands/update_command.rb +29 -44
- data/lib/rubygems/config_file.rb +25 -19
- data/lib/rubygems/custom_require.rb +4 -6
- data/lib/rubygems/dependency.rb +1 -43
- data/lib/rubygems/dependency_installer.rb +1 -1
- data/lib/rubygems/doc_manager.rb +3 -1
- data/lib/rubygems/ext/builder.rb +3 -1
- data/lib/rubygems/ext/rake_builder.rb +10 -2
- data/lib/rubygems/format.rb +7 -4
- data/lib/rubygems/gem_runner.rb +1 -1
- data/lib/rubygems/indexer.rb +11 -74
- data/lib/rubygems/install_update_options.rb +13 -8
- data/lib/rubygems/installer.rb +139 -95
- data/{test/gem_installer_test_case.rb → lib/rubygems/installer_test_case.rb} +41 -2
- data/{test/mockgemui.rb → lib/rubygems/mock_gem_ui.rb} +8 -1
- data/lib/rubygems/old_format.rb +2 -1
- data/lib/rubygems/package.rb +17 -2
- data/lib/rubygems/package/tar_input.rb +7 -3
- data/lib/rubygems/package/tar_output.rb +2 -0
- data/lib/rubygems/package/tar_reader/entry.rb +4 -0
- data/{test/gem_package_tar_test_case.rb → lib/rubygems/package/tar_test_case.rb} +5 -2
- data/lib/rubygems/package_task.rb +6 -4
- data/lib/rubygems/remote_fetcher.rb +10 -2
- data/lib/rubygems/require_paths_builder.rb +2 -1
- data/lib/rubygems/server.rb +3 -44
- data/lib/rubygems/source_index.rb +3 -216
- data/lib/rubygems/spec_fetcher.rb +15 -63
- data/lib/rubygems/specification.rb +1 -1
- data/{test/gemutilities.rb → lib/rubygems/test_case.rb} +219 -90
- data/lib/rubygems/test_utilities.rb +7 -20
- data/lib/rubygems/uninstaller.rb +27 -28
- data/lib/rubygems/user_interaction.rb +81 -42
- data/lib/rubygems/validator.rb +0 -73
- data/test/{bogussources.rb → rubygems/bogussources.rb} +0 -0
- data/test/{data → rubygems/data}/gem-private_key.pem +0 -0
- data/test/{data → rubygems/data}/gem-public_cert.pem +0 -0
- data/test/{fake_certlib → rubygems/fake_certlib}/openssl.rb +0 -0
- data/test/rubygems/foo/discover.rb +0 -0
- data/test/{functional.rb → rubygems/functional.rb} +0 -0
- data/test/{insure_session.rb → rubygems/insure_session.rb} +0 -0
- data/test/{plugin → rubygems/plugin}/exception/rubygems_plugin.rb +0 -0
- data/test/{plugin → rubygems/plugin}/load/rubygems_plugin.rb +0 -0
- data/test/{plugin → rubygems/plugin}/standarderror/rubygems_plugin.rb +0 -0
- data/test/{private_key.pem → rubygems/private_key.pem} +0 -0
- data/test/{public_cert.pem → rubygems/public_cert.pem} +0 -0
- data/test/rubygems/{commands → rubygems/commands}/crash_command.rb +0 -0
- data/test/{rubygems_plugin.rb → rubygems/rubygems_plugin.rb} +0 -0
- data/test/rubygems/sff/discover.rb +0 -0
- data/test/{simple_gem.rb → rubygems/simple_gem.rb} +2 -2
- data/test/{test_config.rb → rubygems/test_config.rb} +2 -2
- data/test/{test_gem.rb → rubygems/test_gem.rb} +12 -2
- data/test/{test_gem_builder.rb → rubygems/test_gem_builder.rb} +2 -2
- data/test/{test_gem_command.rb → rubygems/test_gem_command.rb} +3 -3
- data/test/{test_gem_command_manager.rb → rubygems/test_gem_command_manager.rb} +15 -6
- data/test/{test_gem_commands_build_command.rb → rubygems/test_gem_commands_build_command.rb} +2 -2
- data/test/{test_gem_commands_cert_command.rb → rubygems/test_gem_commands_cert_command.rb} +2 -2
- data/test/{test_gem_commands_check_command.rb → rubygems/test_gem_commands_check_command.rb} +2 -2
- data/test/{test_gem_commands_contents_command.rb → rubygems/test_gem_commands_contents_command.rb} +3 -3
- data/test/{test_gem_commands_dependency_command.rb → rubygems/test_gem_commands_dependency_command.rb} +4 -4
- data/test/{test_gem_commands_environment_command.rb → rubygems/test_gem_commands_environment_command.rb} +12 -3
- data/test/{test_gem_commands_fetch_command.rb → rubygems/test_gem_commands_fetch_command.rb} +2 -2
- data/test/{test_gem_commands_generate_index_command.rb → rubygems/test_gem_commands_generate_index_command.rb} +7 -11
- data/test/{test_gem_commands_install_command.rb → rubygems/test_gem_commands_install_command.rb} +2 -2
- data/test/{test_gem_commands_list_command.rb → rubygems/test_gem_commands_list_command.rb} +2 -2
- data/test/{test_gem_commands_lock_command.rb → rubygems/test_gem_commands_lock_command.rb} +2 -2
- data/test/{test_gem_commands_outdated_command.rb → rubygems/test_gem_commands_outdated_command.rb} +2 -2
- data/test/{test_gem_commands_owner_command.rb → rubygems/test_gem_commands_owner_command.rb} +5 -5
- data/test/{test_gem_commands_pristine_command.rb → rubygems/test_gem_commands_pristine_command.rb} +2 -2
- data/test/{test_gem_commands_push_command.rb → rubygems/test_gem_commands_push_command.rb} +3 -3
- data/test/{test_gem_commands_query_command.rb → rubygems/test_gem_commands_query_command.rb} +2 -2
- data/test/{test_gem_commands_server_command.rb → rubygems/test_gem_commands_server_command.rb} +2 -2
- data/test/{test_gem_commands_sources_command.rb → rubygems/test_gem_commands_sources_command.rb} +8 -8
- data/test/{test_gem_commands_specification_command.rb → rubygems/test_gem_commands_specification_command.rb} +3 -3
- data/test/{test_gem_commands_stale_command.rb → rubygems/test_gem_commands_stale_command.rb} +2 -2
- data/test/{test_gem_commands_uninstall_command.rb → rubygems/test_gem_commands_uninstall_command.rb} +16 -10
- data/test/{test_gem_commands_unpack_command.rb → rubygems/test_gem_commands_unpack_command.rb} +42 -2
- data/test/{test_gem_commands_update_command.rb → rubygems/test_gem_commands_update_command.rb} +2 -2
- data/test/{test_gem_commands_which_command.rb → rubygems/test_gem_commands_which_command.rb} +3 -3
- data/test/{test_gem_config_file.rb → rubygems/test_gem_config_file.rb} +2 -2
- data/test/{test_gem_dependency.rb → rubygems/test_gem_dependency.rb} +3 -27
- data/test/{test_gem_dependency_installer.rb → rubygems/test_gem_dependency_installer.rb} +2 -2
- data/test/{test_gem_dependency_list.rb → rubygems/test_gem_dependency_list.rb} +3 -3
- data/test/{test_gem_doc_manager.rb → rubygems/test_gem_doc_manager.rb} +2 -2
- data/test/{test_gem_ext_configure_builder.rb → rubygems/test_gem_ext_configure_builder.rb} +4 -4
- data/test/{test_gem_ext_ext_conf_builder.rb → rubygems/test_gem_ext_ext_conf_builder.rb} +46 -2
- data/test/{test_gem_ext_rake_builder.rb → rubygems/test_gem_ext_rake_builder.rb} +2 -2
- data/test/{test_gem_format.rb → rubygems/test_gem_format.rb} +24 -6
- data/test/{test_gem_gem_path_searcher.rb → rubygems/test_gem_gem_path_searcher.rb} +2 -2
- data/test/{test_gem_gem_runner.rb → rubygems/test_gem_gem_runner.rb} +2 -2
- data/test/{test_gem_gemcutter_utilities.rb → rubygems/test_gem_gemcutter_utilities.rb} +4 -4
- data/test/{test_gem_indexer.rb → rubygems/test_gem_indexer.rb} +4 -121
- data/test/{test_gem_install_update_options.rb → rubygems/test_gem_install_update_options.rb} +3 -3
- data/test/{test_gem_installer.rb → rubygems/test_gem_installer.rb} +106 -13
- data/test/{test_gem_local_remote_options.rb → rubygems/test_gem_local_remote_options.rb} +2 -2
- data/test/{test_gem_package_tar_header.rb → rubygems/test_gem_package_tar_header.rb} +2 -2
- data/test/{test_gem_package_tar_input.rb → rubygems/test_gem_package_tar_input.rb} +21 -4
- data/test/{test_gem_package_tar_output.rb → rubygems/test_gem_package_tar_output.rb} +2 -2
- data/test/{test_gem_package_tar_reader.rb → rubygems/test_gem_package_tar_reader.rb} +2 -2
- data/test/{test_gem_package_tar_reader_entry.rb → rubygems/test_gem_package_tar_reader_entry.rb} +12 -2
- data/test/{test_gem_package_tar_writer.rb → rubygems/test_gem_package_tar_writer.rb} +2 -2
- data/test/{test_gem_package_task.rb → rubygems/test_gem_package_task.rb} +15 -2
- data/test/{test_gem_platform.rb → rubygems/test_gem_platform.rb} +2 -2
- data/test/{test_gem_remote_fetcher.rb → rubygems/test_gem_remote_fetcher.rb} +7 -7
- data/test/{test_gem_requirement.rb → rubygems/test_gem_requirement.rb} +2 -2
- data/test/{test_gem_security.rb → rubygems/test_gem_security.rb} +3 -4
- data/test/{test_gem_server.rb → rubygems/test_gem_server.rb} +2 -132
- data/test/rubygems/test_gem_silent_ui.rb +113 -0
- data/test/{test_gem_source_index.rb → rubygems/test_gem_source_index.rb} +2 -61
- data/test/{test_gem_spec_fetcher.rb → rubygems/test_gem_spec_fetcher.rb} +2 -2
- data/test/{test_gem_specification.rb → rubygems/test_gem_specification.rb} +4 -4
- data/test/{test_gem_stream_ui.rb → rubygems/test_gem_stream_ui.rb} +24 -2
- data/test/{test_gem_text.rb → rubygems/test_gem_text.rb} +2 -2
- data/test/{test_gem_uninstaller.rb → rubygems/test_gem_uninstaller.rb} +15 -12
- data/test/{test_gem_validator.rb → rubygems/test_gem_validator.rb} +3 -3
- data/test/{test_gem_version.rb → rubygems/test_gem_version.rb} +2 -2
- data/test/{test_gem_version_option.rb → rubygems/test_gem_version_option.rb} +2 -2
- data/test/{test_kernel.rb → rubygems/test_kernel.rb} +7 -10
- metadata +281 -177
- metadata.gz.sig +0 -0
- data/lib/rubygems/commands/mirror_command.rb +0 -111
- data/lib/rubygems/source_info_cache.rb +0 -394
- data/lib/rubygems/source_info_cache_entry.rb +0 -56
- data/test/test_gem_commands_mirror_command.rb +0 -60
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
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 <
|
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
|
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
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/command_manager'
|
3
3
|
|
4
|
-
class TestGemCommandManager <
|
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
|
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)
|
data/test/{test_gem_commands_build_command.rb → rubygems/test_gem_commands_build_command.rb}
RENAMED
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/build_command'
|
3
3
|
require 'rubygems/format'
|
4
4
|
|
5
|
-
class TestGemCommandsBuildCommand <
|
5
|
+
class TestGemCommandsBuildCommand < Gem::TestCase
|
6
6
|
|
7
7
|
def setup
|
8
8
|
super
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
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 <
|
8
|
+
class TestGemCommandsCertCommand < Gem::TestCase
|
9
9
|
|
10
10
|
def setup
|
11
11
|
super
|
data/test/{test_gem_commands_contents_command.rb → rubygems/test_gem_commands_contents_command.rb}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/contents_command'
|
3
3
|
|
4
|
-
class TestGemCommandsContentsCommand <
|
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
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/dependency_command'
|
3
3
|
|
4
|
-
class TestGemCommandsDependencyCommand <
|
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
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/environment_command'
|
3
3
|
|
4
|
-
class TestGemCommandsEnvironmentCommand <
|
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
|
-
|
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
|
data/test/{test_gem_commands_fetch_command.rb → rubygems/test_gem_commands_fetch_command.rb}
RENAMED
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
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 <
|
6
|
+
class TestGemCommandsFetchCommand < Gem::TestCase
|
7
7
|
|
8
8
|
def setup
|
9
9
|
super
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/indexer'
|
3
3
|
require 'rubygems/commands/generate_index_command'
|
4
4
|
|
5
|
-
class TestGemCommandsGenerateIndexCommand <
|
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
|
-
|
20
|
-
|
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?(
|
25
|
-
assert File.exist?(
|
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
|
data/test/{test_gem_commands_install_command.rb → rubygems/test_gem_commands_install_command.rb}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/install_command'
|
3
3
|
|
4
|
-
class TestGemCommandsInstallCommand <
|
4
|
+
class TestGemCommandsInstallCommand < Gem::TestCase
|
5
5
|
|
6
6
|
def setup
|
7
7
|
super
|
data/test/{test_gem_commands_outdated_command.rb → rubygems/test_gem_commands_outdated_command.rb}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/outdated_command'
|
3
3
|
|
4
|
-
class TestGemCommandsOutdatedCommand <
|
4
|
+
class TestGemCommandsOutdatedCommand < Gem::TestCase
|
5
5
|
|
6
6
|
def setup
|
7
7
|
super
|
data/test/{test_gem_commands_owner_command.rb → rubygems/test_gem_commands_owner_command.rb}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/owner_command'
|
3
3
|
|
4
|
-
class TestGemCommandsOwnerCommand <
|
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
|
data/test/{test_gem_commands_pristine_command.rb → rubygems/test_gem_commands_pristine_command.rb}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/pristine_command'
|
3
3
|
|
4
|
-
class TestGemCommandsPristineCommand <
|
4
|
+
class TestGemCommandsPristineCommand < Gem::TestCase
|
5
5
|
|
6
6
|
def setup
|
7
7
|
super
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/push_command'
|
3
3
|
|
4
|
-
class TestGemCommandsPushCommand <
|
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
|
data/test/{test_gem_commands_sources_command.rb → rubygems/test_gem_commands_sources_command.rb}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/sources_command'
|
3
3
|
|
4
|
-
class TestGemCommandsSourcesCommand <
|
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
|
-
|
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
|
-
|
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
|
1
|
+
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/commands/specification_command'
|
3
3
|
|
4
|
-
class TestGemCommandsSpecificationCommand <
|
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
|