rubygems-update 1.7.2 → 1.8.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 +5 -1
- data/History.txt +101 -4
- data/LICENSE.txt +42 -37
- data/MIT.txt +20 -0
- data/Manifest.txt +5 -4
- data/Rakefile +6 -7
- data/lib/rubygems.rb +175 -278
- data/lib/rubygems/builder.rb +7 -6
- data/lib/rubygems/command_manager.rb +16 -2
- data/lib/rubygems/commands/build_command.rb +13 -11
- data/lib/rubygems/commands/cert_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +10 -19
- data/lib/rubygems/commands/contents_command.rb +5 -5
- data/lib/rubygems/commands/dependency_command.rb +17 -40
- data/lib/rubygems/commands/fetch_command.rb +1 -1
- data/lib/rubygems/commands/install_command.rb +2 -1
- data/lib/rubygems/commands/lock_command.rb +4 -4
- data/lib/rubygems/commands/outdated_command.rb +18 -6
- data/lib/rubygems/commands/pristine_command.rb +25 -15
- data/lib/rubygems/commands/query_command.rb +9 -6
- data/lib/rubygems/commands/setup_command.rb +1 -1
- data/lib/rubygems/commands/specification_command.rb +8 -23
- data/lib/rubygems/commands/stale_command.rb +2 -1
- data/lib/rubygems/commands/unpack_command.rb +7 -5
- data/lib/rubygems/commands/update_command.rb +2 -4
- data/lib/rubygems/commands/which_command.rb +5 -9
- data/lib/rubygems/config_file.rb +9 -7
- data/lib/rubygems/custom_require.rb +6 -4
- data/lib/rubygems/defaults.rb +30 -14
- data/lib/rubygems/dependency.rb +44 -1
- data/lib/rubygems/dependency_installer.rb +37 -41
- data/lib/rubygems/dependency_list.rb +20 -9
- data/lib/rubygems/deprecate.rb +3 -3
- data/lib/rubygems/doc_manager.rb +10 -11
- data/lib/rubygems/ext/rake_builder.rb +1 -1
- data/lib/rubygems/gem_path_searcher.rb +19 -4
- data/lib/rubygems/gem_runner.rb +1 -1
- data/lib/rubygems/indexer.rb +117 -123
- data/lib/rubygems/installer.rb +101 -94
- data/lib/rubygems/installer_test_case.rb +28 -30
- data/lib/rubygems/local_remote_options.rb +1 -1
- data/lib/rubygems/mock_gem_ui.rb +10 -3
- data/lib/rubygems/package.rb +0 -26
- data/lib/rubygems/package/tar_input.rb +5 -6
- data/lib/rubygems/package_task.rb +1 -1
- data/lib/rubygems/path_support.rb +72 -0
- data/lib/rubygems/platform.rb +12 -2
- data/lib/rubygems/remote_fetcher.rb +7 -6
- data/lib/rubygems/requirement.rb +3 -0
- data/lib/rubygems/security.rb +1 -1
- data/lib/rubygems/server.rb +67 -67
- data/lib/rubygems/source_index.rb +58 -29
- data/lib/rubygems/spec_fetcher.rb +5 -1
- data/lib/rubygems/specification.rb +1422 -877
- data/lib/rubygems/test_case.rb +114 -64
- data/lib/rubygems/test_utilities.rb +4 -3
- data/lib/rubygems/text.rb +1 -1
- data/lib/rubygems/uninstaller.rb +37 -44
- data/test/rubygems/test_gem.rb +131 -102
- data/test/rubygems/test_gem_builder.rb +18 -1
- data/test/rubygems/test_gem_command_manager.rb +2 -0
- data/test/rubygems/test_gem_commands_build_command.rb +31 -3
- data/test/rubygems/test_gem_commands_cleanup_command.rb +51 -0
- data/test/rubygems/test_gem_commands_dependency_command.rb +1 -10
- data/test/rubygems/test_gem_commands_fetch_command.rb +5 -4
- data/test/rubygems/test_gem_commands_help_command.rb +58 -0
- data/test/rubygems/test_gem_commands_install_command.rb +25 -24
- data/test/rubygems/test_gem_commands_list_command.rb +1 -4
- data/test/rubygems/test_gem_commands_outdated_command.rb +10 -9
- data/test/rubygems/test_gem_commands_pristine_command.rb +63 -22
- data/test/rubygems/test_gem_commands_push_command.rb +1 -1
- data/test/rubygems/test_gem_commands_query_command.rb +15 -82
- data/test/rubygems/test_gem_commands_sources_command.rb +8 -9
- data/test/rubygems/test_gem_commands_specification_command.rb +10 -6
- data/test/rubygems/test_gem_commands_stale_command.rb +4 -4
- data/test/rubygems/test_gem_commands_unpack_command.rb +20 -21
- data/test/rubygems/test_gem_commands_update_command.rb +19 -23
- data/test/rubygems/test_gem_commands_which_command.rb +7 -4
- data/test/rubygems/test_gem_dependency.rb +14 -8
- data/test/rubygems/test_gem_dependency_installer.rb +87 -33
- data/test/rubygems/test_gem_dependency_list.rb +7 -3
- data/test/rubygems/test_gem_doc_manager.rb +3 -3
- data/test/rubygems/test_gem_format.rb +1 -1
- data/test/rubygems/test_gem_gem_path_searcher.rb +45 -29
- data/test/rubygems/test_gem_indexer.rb +48 -47
- data/test/rubygems/test_gem_install_update_options.rb +6 -5
- data/test/rubygems/test_gem_installer.rb +61 -37
- data/test/rubygems/test_gem_path_support.rb +58 -0
- data/test/rubygems/test_gem_platform.rb +5 -5
- data/test/rubygems/test_gem_remote_fetcher.rb +18 -21
- data/test/rubygems/test_gem_server.rb +23 -15
- data/test/rubygems/test_gem_source_index.rb +165 -127
- data/test/rubygems/test_gem_spec_fetcher.rb +42 -49
- data/test/rubygems/test_gem_specification.rb +104 -74
- data/test/rubygems/test_gem_text.rb +15 -0
- data/test/rubygems/test_gem_uninstaller.rb +15 -26
- data/test/rubygems/test_kernel.rb +1 -2
- metadata +64 -14
- metadata.gz.sig +0 -0
- data/GPL.txt +0 -340
- data/pkgs/sources/lib/sources.rb +0 -3
- data/pkgs/sources/sources.gemspec +0 -14
- data/test/rubygems/functional.rb +0 -92
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rubygems/test_case'
|
2
2
|
require 'rubygems/builder'
|
3
|
+
require 'rubygems/package'
|
3
4
|
|
4
5
|
class TestGemBuilder < Gem::TestCase
|
5
6
|
|
@@ -23,5 +24,21 @@ class TestGemBuilder < Gem::TestCase
|
|
23
24
|
end
|
24
25
|
end
|
25
26
|
|
26
|
-
|
27
|
+
def test_build_specification_result
|
28
|
+
util_make_gems
|
29
|
+
|
30
|
+
spec = build_gem_and_yield_spec @a1
|
31
|
+
|
32
|
+
assert_operator @a1, :eql?, spec
|
33
|
+
end
|
27
34
|
|
35
|
+
def build_gem_and_yield_spec(spec)
|
36
|
+
builder = Gem::Builder.new spec
|
37
|
+
|
38
|
+
spec = Dir.chdir @tempdir do
|
39
|
+
FileUtils.mkdir 'lib'
|
40
|
+
File.open('lib/code.rb', 'w') { |f| f << "something" }
|
41
|
+
Gem::Package.open(File.open(builder.build)) { |x| x.metadata }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -23,6 +23,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
23
23
|
end
|
24
24
|
ensure
|
25
25
|
$:.replace old_load_path
|
26
|
+
Gem::CommandManager.reset
|
26
27
|
end
|
27
28
|
|
28
29
|
def test_run_crash_command
|
@@ -40,6 +41,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
40
41
|
end
|
41
42
|
ensure
|
42
43
|
$:.replace old_load_path
|
44
|
+
@command_manager.unregister_command :crash
|
43
45
|
end
|
44
46
|
|
45
47
|
def test_process_args_bad_arg
|
@@ -34,10 +34,38 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
34
34
|
util_test_build_gem @gem, gemspec_file
|
35
35
|
end
|
36
36
|
|
37
|
-
def
|
37
|
+
def test_execute_bad_spec
|
38
|
+
@gem.date = "2010-11-08"
|
39
|
+
|
40
|
+
gemspec_file = File.join(@tempdir, @gem.spec_name)
|
41
|
+
|
42
|
+
File.open gemspec_file, 'w' do |gs|
|
43
|
+
gs.write @gem.to_ruby.sub(/11-08/, "11-8")
|
44
|
+
end
|
45
|
+
|
46
|
+
@cmd.options[:args] = [gemspec_file]
|
47
|
+
|
48
|
+
out, err = use_ui @ui do
|
49
|
+
capture_io do
|
50
|
+
assert_raises Gem::MockGemUi::TermError do
|
51
|
+
@cmd.execute
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
assert_equal "", out
|
57
|
+
assert_match(/invalid date format in specification/, err)
|
58
|
+
|
59
|
+
assert_equal '', @ui.output
|
60
|
+
assert_equal "ERROR: Error loading gemspec. Aborting.\n", @ui.error
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_execute_missing_file
|
38
64
|
@cmd.options[:args] = %w[some_gem]
|
39
65
|
use_ui @ui do
|
40
|
-
|
66
|
+
assert_raises Gem::MockGemUi::TermError do
|
67
|
+
@cmd.execute
|
68
|
+
end
|
41
69
|
end
|
42
70
|
|
43
71
|
assert_equal '', @ui.output
|
@@ -61,7 +89,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
61
89
|
assert_equal [], output
|
62
90
|
assert_equal '', @ui.error
|
63
91
|
|
64
|
-
gem_file = File.join @tempdir, gem.
|
92
|
+
gem_file = File.join @tempdir, File.basename(gem.cache_file)
|
65
93
|
assert File.exist?(gem_file)
|
66
94
|
|
67
95
|
spec = Gem::Format.from_file_by_path(gem_file).spec
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'rubygems/test_case'
|
2
|
+
require 'rubygems/commands/cleanup_command'
|
3
|
+
|
4
|
+
class TestGemCommandsCleanupCommand < Gem::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
|
9
|
+
@cmd = Gem::Commands::CleanupCommand.new
|
10
|
+
|
11
|
+
@a_1 = quick_spec 'a', 1
|
12
|
+
@a_2 = quick_spec 'a', 2
|
13
|
+
|
14
|
+
install_gem @a_1
|
15
|
+
install_gem @a_2
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_execute
|
19
|
+
@cmd.options[:args] = %w[a]
|
20
|
+
|
21
|
+
@cmd.execute
|
22
|
+
|
23
|
+
refute_path_exists @a_1.gem_dir
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_execute_all
|
27
|
+
@b_1 = quick_spec 'b', 1
|
28
|
+
@b_2 = quick_spec 'b', 2
|
29
|
+
|
30
|
+
install_gem @b_1
|
31
|
+
install_gem @b_2
|
32
|
+
|
33
|
+
@cmd.options[:args] = []
|
34
|
+
|
35
|
+
@cmd.execute
|
36
|
+
|
37
|
+
refute_path_exists @a_1.gem_dir
|
38
|
+
refute_path_exists @b_1.gem_dir
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_execute_dry_run
|
42
|
+
@cmd.options[:args] = %w[a]
|
43
|
+
@cmd.options[:dryrun] = true
|
44
|
+
|
45
|
+
@cmd.execute
|
46
|
+
|
47
|
+
assert_path_exists @a_1.gem_dir
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
@@ -18,8 +18,6 @@ class TestGemCommandsDependencyCommand < Gem::TestCase
|
|
18
18
|
gem.add_dependency 'baz', '> 1'
|
19
19
|
end
|
20
20
|
|
21
|
-
Gem.source_index = nil
|
22
|
-
|
23
21
|
@cmd.options[:args] = %w[foo]
|
24
22
|
|
25
23
|
use_ui @ui do
|
@@ -32,8 +30,6 @@ class TestGemCommandsDependencyCommand < Gem::TestCase
|
|
32
30
|
end
|
33
31
|
|
34
32
|
def test_execute_no_args
|
35
|
-
Gem.source_index = nil
|
36
|
-
|
37
33
|
@cmd.options[:args] = []
|
38
34
|
|
39
35
|
use_ui @ui do
|
@@ -93,8 +89,6 @@ Gem pl-1-x86-linux
|
|
93
89
|
end
|
94
90
|
|
95
91
|
def test_execute_regexp
|
96
|
-
Gem.source_index = nil
|
97
|
-
|
98
92
|
@cmd.options[:args] = %w[/[ab]/]
|
99
93
|
|
100
94
|
use_ui @ui do
|
@@ -130,8 +124,6 @@ Gem b-2
|
|
130
124
|
gem.add_dependency 'foo'
|
131
125
|
end
|
132
126
|
|
133
|
-
Gem.source_index = nil
|
134
|
-
|
135
127
|
@cmd.options[:args] = %w[foo]
|
136
128
|
@cmd.options[:reverse_dependencies] = true
|
137
129
|
|
@@ -197,10 +189,9 @@ ERROR: Only reverse dependencies for local gems are supported.
|
|
197
189
|
@fetcher = Gem::FakeFetcher.new
|
198
190
|
Gem::RemoteFetcher.fetcher = @fetcher
|
199
191
|
|
192
|
+
util_clear_gems
|
200
193
|
util_setup_spec_fetcher @a2_pre
|
201
194
|
|
202
|
-
FileUtils.rm File.join(@gemhome, 'specifications', @a2_pre.spec_name)
|
203
|
-
|
204
195
|
@cmd.options[:args] = %w[a]
|
205
196
|
@cmd.options[:domain] = :remote
|
206
197
|
@cmd.options[:prerelease] = true
|
@@ -16,7 +16,7 @@ class TestGemCommandsFetchCommand < Gem::TestCase
|
|
16
16
|
util_setup_spec_fetcher @a2
|
17
17
|
|
18
18
|
@fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] =
|
19
|
-
File.read(
|
19
|
+
File.read(@a2.cache_file)
|
20
20
|
|
21
21
|
@cmd.options[:args] = [@a2.name]
|
22
22
|
|
@@ -32,12 +32,13 @@ class TestGemCommandsFetchCommand < Gem::TestCase
|
|
32
32
|
|
33
33
|
def test_execute_prerelease
|
34
34
|
util_setup_fake_fetcher true
|
35
|
+
util_clear_gems
|
35
36
|
util_setup_spec_fetcher @a2, @a2_pre
|
36
37
|
|
37
38
|
@fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] =
|
38
|
-
File.read(
|
39
|
+
File.read(@a2.cache_file)
|
39
40
|
@fetcher.data["#{@gem_repo}gems/#{@a2_pre.file_name}"] =
|
40
|
-
File.read(
|
41
|
+
File.read(@a2_pre.cache_file)
|
41
42
|
|
42
43
|
@cmd.options[:args] = [@a2.name]
|
43
44
|
@cmd.options[:prerelease] = true
|
@@ -57,7 +58,7 @@ class TestGemCommandsFetchCommand < Gem::TestCase
|
|
57
58
|
util_setup_spec_fetcher @a1, @a2
|
58
59
|
|
59
60
|
@fetcher.data["#{@gem_repo}gems/#{@a1.file_name}"] =
|
60
|
-
File.read(
|
61
|
+
File.read(@a1.cache_file)
|
61
62
|
|
62
63
|
@cmd.options[:args] = [@a2.name]
|
63
64
|
@cmd.options[:version] = Gem::Requirement.new '1'
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "rubygems/test_case"
|
3
|
+
require "rubygems/commands/help_command"
|
4
|
+
require "rubygems/format"
|
5
|
+
require "rubygems/command_manager"
|
6
|
+
|
7
|
+
class TestGemCommandsHelpCommand < Gem::TestCase
|
8
|
+
def setup
|
9
|
+
super
|
10
|
+
|
11
|
+
@cmd = Gem::Commands::HelpCommand.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_gem_help_bad
|
15
|
+
util_gem 'bad' do |out, err|
|
16
|
+
assert_equal('', out)
|
17
|
+
assert_match(/Unknown command bad. Try gem help commands\n/, err)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_gem_help_platforms
|
22
|
+
util_gem 'platforms' do |out, err|
|
23
|
+
assert_match(/x86-freebsd/, out)
|
24
|
+
assert_equal '', err
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_gem_help_commands
|
29
|
+
mgr = Gem::CommandManager.new
|
30
|
+
|
31
|
+
util_gem 'commands' do |out, err|
|
32
|
+
mgr.command_names.each do |cmd|
|
33
|
+
assert_match(/\s+#{cmd}\s+\S+/, out)
|
34
|
+
end
|
35
|
+
assert_equal '', err
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_gem_no_args_shows_help
|
40
|
+
util_gem do |out, err|
|
41
|
+
assert_match(/Usage:/, out)
|
42
|
+
assert_match(/gem install/, out)
|
43
|
+
assert_equal '', err
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def util_gem *args
|
48
|
+
@cmd.options[:args] = args
|
49
|
+
|
50
|
+
use_ui @ui do
|
51
|
+
Dir.chdir @tempdir do
|
52
|
+
@cmd.execute
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
yield @ui.output, @ui.error
|
57
|
+
end
|
58
|
+
end
|
@@ -18,13 +18,13 @@ class TestGemCommandsInstallCommand < Gem::TestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_execute_exclude_prerelease
|
21
|
-
util_setup_fake_fetcher
|
22
|
-
util_setup_spec_fetcher
|
21
|
+
util_setup_fake_fetcher :prerelease
|
22
|
+
util_setup_spec_fetcher
|
23
23
|
|
24
24
|
@fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] =
|
25
|
-
read_binary(
|
25
|
+
read_binary(@a2.cache_file)
|
26
26
|
@fetcher.data["#{@gem_repo}gems/#{@a2_pre.file_name}"] =
|
27
|
-
read_binary(
|
27
|
+
read_binary(@a2_pre.cache_file)
|
28
28
|
|
29
29
|
@cmd.options[:args] = [@a2.name]
|
30
30
|
|
@@ -40,13 +40,13 @@ class TestGemCommandsInstallCommand < Gem::TestCase
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_execute_explicit_version_includes_prerelease
|
43
|
-
util_setup_fake_fetcher
|
44
|
-
util_setup_spec_fetcher
|
43
|
+
util_setup_fake_fetcher :prerelease
|
44
|
+
util_setup_spec_fetcher
|
45
45
|
|
46
46
|
@fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] =
|
47
|
-
read_binary(
|
47
|
+
read_binary(@a2.cache_file)
|
48
48
|
@fetcher.data["#{@gem_repo}gems/#{@a2_pre.file_name}"] =
|
49
|
-
read_binary(
|
49
|
+
read_binary(@a2_pre.cache_file)
|
50
50
|
|
51
51
|
@cmd.handle_options [@a2_pre.name, '--version', @a2_pre.version.to_s,
|
52
52
|
"--no-ri", "--no-rdoc"]
|
@@ -86,7 +86,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
|
|
86
86
|
util_setup_fake_fetcher
|
87
87
|
@cmd.options[:domain] = :local
|
88
88
|
|
89
|
-
FileUtils.mv
|
89
|
+
FileUtils.mv @a2.cache_file, @tempdir
|
90
90
|
|
91
91
|
@cmd.options[:args] = [@a2.name]
|
92
92
|
|
@@ -115,15 +115,15 @@ class TestGemCommandsInstallCommand < Gem::TestCase
|
|
115
115
|
util_setup_fake_fetcher
|
116
116
|
@cmd.options[:user_install] = false
|
117
117
|
|
118
|
-
FileUtils.mv
|
118
|
+
FileUtils.mv @a2.cache_file, @tempdir
|
119
119
|
|
120
120
|
@cmd.options[:args] = [@a2.name]
|
121
121
|
|
122
122
|
use_ui @ui do
|
123
123
|
orig_dir = Dir.pwd
|
124
124
|
begin
|
125
|
-
|
126
|
-
|
125
|
+
FileUtils.chmod 0755, @userhome
|
126
|
+
FileUtils.chmod 0555, @gemhome
|
127
127
|
|
128
128
|
Dir.chdir @tempdir
|
129
129
|
assert_raises Gem::FilePermissionError do
|
@@ -131,7 +131,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
|
|
131
131
|
end
|
132
132
|
ensure
|
133
133
|
Dir.chdir orig_dir
|
134
|
-
|
134
|
+
FileUtils.chmod 0755, @gemhome
|
135
135
|
end
|
136
136
|
end
|
137
137
|
end
|
@@ -202,13 +202,14 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
202
202
|
end
|
203
203
|
|
204
204
|
def test_execute_prerelease
|
205
|
-
util_setup_fake_fetcher
|
205
|
+
util_setup_fake_fetcher :prerelease
|
206
|
+
util_clear_gems
|
206
207
|
util_setup_spec_fetcher @a2, @a2_pre
|
207
208
|
|
208
209
|
@fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] =
|
209
|
-
read_binary(
|
210
|
+
read_binary(@a2.cache_file)
|
210
211
|
@fetcher.data["#{@gem_repo}gems/#{@a2_pre.file_name}"] =
|
211
|
-
read_binary(
|
212
|
+
read_binary(@a2_pre.cache_file)
|
212
213
|
|
213
214
|
@cmd.options[:prerelease] = true
|
214
215
|
@cmd.options[:args] = [@a2_pre.name]
|
@@ -229,10 +230,10 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
229
230
|
@cmd.options[:generate_ri] = true
|
230
231
|
|
231
232
|
util_setup_fake_fetcher
|
232
|
-
util_setup_spec_fetcher
|
233
|
+
util_setup_spec_fetcher
|
233
234
|
|
234
235
|
@fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] =
|
235
|
-
read_binary(
|
236
|
+
read_binary(@a2.cache_file)
|
236
237
|
|
237
238
|
@cmd.options[:args] = [@a2.name]
|
238
239
|
|
@@ -259,9 +260,9 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
259
260
|
util_setup_fake_fetcher
|
260
261
|
@cmd.options[:domain] = :local
|
261
262
|
|
262
|
-
FileUtils.mv
|
263
|
+
FileUtils.mv @a2.cache_file, @tempdir
|
263
264
|
|
264
|
-
FileUtils.mv
|
265
|
+
FileUtils.mv @b2.cache_file, @tempdir
|
265
266
|
|
266
267
|
@cmd.options[:args] = [@a2.name, @b2.name]
|
267
268
|
|
@@ -287,10 +288,10 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
287
288
|
|
288
289
|
def test_execute_conservative
|
289
290
|
util_setup_fake_fetcher
|
290
|
-
util_setup_spec_fetcher
|
291
|
+
util_setup_spec_fetcher
|
291
292
|
|
292
293
|
@fetcher.data["#{@gem_repo}gems/#{@b2.file_name}"] =
|
293
|
-
read_binary(
|
294
|
+
read_binary(@b2.cache_file)
|
294
295
|
|
295
296
|
uninstall_gem(@b2)
|
296
297
|
|
@@ -302,16 +303,16 @@ ERROR: Possible alternatives: non_existent_with_hint
|
|
302
303
|
orig_dir = Dir.pwd
|
303
304
|
begin
|
304
305
|
Dir.chdir @tempdir
|
305
|
-
|
306
|
+
assert_raises Gem::SystemExitException do
|
306
307
|
@cmd.execute
|
307
308
|
end
|
308
|
-
assert_equal 0, e.exit_code
|
309
309
|
ensure
|
310
310
|
Dir.chdir orig_dir
|
311
311
|
end
|
312
312
|
end
|
313
313
|
|
314
314
|
out = @ui.output.split "\n"
|
315
|
+
assert_equal "", @ui.error
|
315
316
|
assert_equal "Successfully installed #{@b2.full_name}", out.shift
|
316
317
|
assert_equal "1 gem installed", out.shift
|
317
318
|
assert out.empty?, out.inspect
|
@@ -20,16 +20,13 @@ class TestGemCommandsListCommand < Gem::TestCase
|
|
20
20
|
def test_execute_installed
|
21
21
|
@cmd.handle_options %w[c --installed]
|
22
22
|
|
23
|
-
|
23
|
+
assert_raises Gem::MockGemUi::SystemExitException do
|
24
24
|
use_ui @ui do
|
25
25
|
@cmd.execute
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
assert_equal 0, e.exit_code
|
30
|
-
|
31
29
|
assert_equal "true\n", @ui.output
|
32
|
-
|
33
30
|
assert_equal '', @ui.error
|
34
31
|
end
|
35
32
|
|