rubygems-update 3.4.19 → 3.4.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +58 -0
- data/Manifest.txt +1 -0
- data/bundler/CHANGELOG.md +62 -2
- data/bundler/lib/bundler/build_metadata.rb +3 -3
- data/bundler/lib/bundler/cli/check.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +1 -3
- data/bundler/lib/bundler/cli/info.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +2 -2
- data/bundler/lib/bundler/cli/lock.rb +26 -23
- data/bundler/lib/bundler/cli/open.rb +5 -7
- data/bundler/lib/bundler/cli/update.rb +1 -0
- data/bundler/lib/bundler/definition.rb +42 -25
- data/bundler/lib/bundler/env.rb +2 -2
- data/bundler/lib/bundler/fetcher/base.rb +2 -2
- data/bundler/lib/bundler/fetcher/compact_index.rb +1 -5
- data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +31 -30
- data/bundler/lib/bundler/gem_version_promoter.rb +2 -2
- data/bundler/lib/bundler/index.rb +62 -31
- data/bundler/lib/bundler/injector.rb +1 -1
- data/bundler/lib/bundler/installer/parallel_installer.rb +0 -26
- data/bundler/lib/bundler/installer/standalone.rb +15 -1
- data/bundler/lib/bundler/lockfile_parser.rb +32 -39
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +1 -1
- data/bundler/lib/bundler/man/bundle-console.1 +1 -1
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +2 -2
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +2 -3
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-help.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-plugin.1 +17 -17
- data/bundler/lib/bundler/man/bundle-plugin.1.ronn +5 -5
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-version.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +12 -1
- data/bundler/lib/bundler/man/gemfile.5.ronn +5 -0
- data/bundler/lib/bundler/plugin.rb +1 -1
- data/bundler/lib/bundler/resolver/package.rb +5 -0
- data/bundler/lib/bundler/resolver.rb +45 -10
- data/bundler/lib/bundler/retry.rb +1 -1
- data/bundler/lib/bundler/ruby_dsl.rb +23 -2
- data/bundler/lib/bundler/ruby_version.rb +8 -1
- data/bundler/lib/bundler/self_manager.rb +2 -0
- data/bundler/lib/bundler/settings.rb +86 -25
- data/bundler/lib/bundler/shared_helpers.rb +16 -1
- data/bundler/lib/bundler/source/git/git_proxy.rb +27 -6
- data/bundler/lib/bundler/source/rubygems.rb +22 -25
- data/bundler/lib/bundler/spec_set.rb +2 -2
- data/bundler/lib/bundler/stub_specification.rb +4 -2
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +6 -2
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +1 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler/yaml_serializer.rb +6 -7
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/basic_specification.rb +3 -3
- data/lib/rubygems/command.rb +17 -20
- data/lib/rubygems/command_manager.rb +1 -1
- data/lib/rubygems/commands/cert_command.rb +3 -3
- data/lib/rubygems/commands/check_command.rb +5 -1
- data/lib/rubygems/commands/cleanup_command.rb +1 -1
- data/lib/rubygems/commands/contents_command.rb +1 -1
- data/lib/rubygems/commands/dependency_command.rb +3 -4
- data/lib/rubygems/commands/help_command.rb +2 -2
- data/lib/rubygems/commands/open_command.rb +1 -3
- data/lib/rubygems/commands/owner_command.rb +9 -11
- data/lib/rubygems/commands/setup_command.rb +8 -8
- data/lib/rubygems/commands/specification_command.rb +5 -1
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +6 -7
- data/lib/rubygems/commands/unpack_command.rb +4 -6
- data/lib/rubygems/commands/update_command.rb +3 -3
- data/lib/rubygems/commands/yank_command.rb +1 -1
- data/lib/rubygems/config_file.rb +60 -13
- data/lib/rubygems/core_ext/kernel_gem.rb +2 -2
- data/lib/rubygems/core_ext/kernel_require.rb +1 -1
- data/lib/rubygems/core_ext/kernel_warn.rb +4 -5
- data/lib/rubygems/defaults.rb +6 -2
- data/lib/rubygems/dependency_installer.rb +8 -12
- data/lib/rubygems/deprecate.rb +4 -3
- data/lib/rubygems/doctor.rb +1 -1
- data/lib/rubygems/errors.rb +1 -1
- data/lib/rubygems/exceptions.rb +1 -1
- data/lib/rubygems/ext/builder.rb +5 -4
- data/lib/rubygems/ext/cargo_builder.rb +2 -2
- data/lib/rubygems/gem_runner.rb +5 -1
- data/lib/rubygems/gemcutter_utilities.rb +4 -4
- data/lib/rubygems/indexer.rb +1 -1
- data/lib/rubygems/install_update_options.rb +1 -1
- data/lib/rubygems/installer.rb +17 -19
- data/lib/rubygems/name_tuple.rb +1 -1
- data/lib/rubygems/package/old.rb +1 -1
- data/lib/rubygems/package/tar_reader/entry.rb +18 -20
- data/lib/rubygems/package/tar_reader.rb +0 -5
- data/lib/rubygems/package/tar_writer.rb +1 -1
- data/lib/rubygems/package.rb +18 -12
- data/lib/rubygems/platform.rb +6 -2
- data/lib/rubygems/query_utils.rb +5 -5
- data/lib/rubygems/remote_fetcher.rb +10 -2
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/request_set.rb +2 -1
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver/activation_request.rb +2 -4
- data/lib/rubygems/resolver/api_set.rb +2 -1
- data/lib/rubygems/resolver/api_specification.rb +1 -1
- data/lib/rubygems/resolver/installed_specification.rb +1 -1
- data/lib/rubygems/resolver/local_specification.rb +1 -1
- data/lib/rubygems/s3_uri_signer.rb +1 -1
- data/lib/rubygems/security/signer.rb +10 -2
- data/lib/rubygems/security/trust_dir.rb +8 -10
- data/lib/rubygems/security.rb +2 -2
- data/lib/rubygems/security_option.rb +1 -1
- data/lib/rubygems/source/local.rb +34 -37
- data/lib/rubygems/source.rb +7 -3
- data/lib/rubygems/source_list.rb +2 -2
- data/lib/rubygems/spec_fetcher.rb +29 -33
- data/lib/rubygems/specification.rb +43 -36
- data/lib/rubygems/specification_policy.rb +36 -35
- data/lib/rubygems/stub_specification.rb +13 -10
- data/lib/rubygems/uninstaller.rb +2 -2
- data/lib/rubygems/update_suggestion.rb +1 -1
- data/lib/rubygems/user_interaction.rb +2 -2
- data/lib/rubygems/util/licenses.rb +115 -0
- data/lib/rubygems/util.rb +5 -1
- data/lib/rubygems/validator.rb +5 -7
- data/lib/rubygems/version.rb +3 -2
- data/lib/rubygems/yaml_serializer.rb +88 -0
- data/lib/rubygems.rb +8 -10
- data/rubygems-update.gemspec +1 -1
- data/setup.rb +2 -0
- data/test/rubygems/bundler_test_gem.rb +6 -3
- data/test/rubygems/helper.rb +38 -32
- data/test/rubygems/package/tar_test_case.rb +2 -2
- data/test/rubygems/test_gem.rb +55 -30
- data/test/rubygems/test_gem_command.rb +3 -1
- data/test/rubygems/test_gem_commands_build_command.rb +2 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +22 -22
- data/test/rubygems/test_gem_commands_cleanup_command.rb +2 -2
- data/test/rubygems/test_gem_commands_environment_command.rb +2 -1
- data/test/rubygems/test_gem_commands_exec_command.rb +5 -1
- data/test/rubygems/test_gem_commands_install_command.rb +3 -3
- data/test/rubygems/test_gem_commands_open_command.rb +5 -2
- data/test/rubygems/test_gem_commands_pristine_command.rb +2 -2
- data/test/rubygems/test_gem_commands_push_command.rb +7 -6
- data/test/rubygems/test_gem_commands_signin_command.rb +8 -8
- data/test/rubygems/test_gem_commands_stale_command.rb +1 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -1
- data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
- data/test/rubygems/test_gem_config_file.rb +46 -12
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.lock +28 -12
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +16 -14
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder.rb +2 -2
- data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -5
- data/test/rubygems/test_gem_indexer.rb +1 -1
- data/test/rubygems/test_gem_install_update_options.rb +3 -3
- data/test/rubygems/test_gem_installer.rb +15 -15
- data/test/rubygems/test_gem_package.rb +152 -36
- data/test/rubygems/test_gem_package_old.rb +1 -1
- data/test/rubygems/test_gem_package_tar_header.rb +10 -10
- data/test/rubygems/test_gem_package_tar_reader.rb +4 -4
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +53 -1
- data/test/rubygems/test_gem_package_tar_writer.rb +41 -41
- data/test/rubygems/test_gem_rdoc.rb +2 -2
- data/test/rubygems/test_gem_remote_fetcher.rb +34 -34
- data/test/rubygems/test_gem_request.rb +5 -5
- data/test/rubygems/test_gem_request_connection_pools.rb +2 -1
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +14 -7
- data/test/rubygems/test_gem_requirement.rb +1 -1
- data/test/rubygems/test_gem_security.rb +2 -2
- data/test/rubygems/test_gem_security_signer.rb +2 -2
- data/test/rubygems/test_gem_security_trust_dir.rb +6 -6
- data/test/rubygems/test_gem_spec_fetcher.rb +2 -2
- data/test/rubygems/test_gem_specification.rb +71 -35
- data/test/rubygems/test_gem_update_suggestion.rb +23 -23
- data/test/rubygems/test_gem_util.rb +2 -2
- data/test/rubygems/test_gem_version.rb +4 -2
- data/test/rubygems/test_require.rb +4 -6
- data/test/rubygems/utilities.rb +4 -3
- metadata +4 -3
data/test/rubygems/helper.rb
CHANGED
@@ -118,30 +118,30 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
118
118
|
# https://github.com/seattlerb/minitest/blob/21d9e804b63c619f602f3f4ece6c71b48974707a/lib/minitest/assertions.rb#L546
|
119
119
|
def capture_subprocess_io
|
120
120
|
_synchronize do
|
121
|
-
|
122
|
-
require "tempfile"
|
121
|
+
require "tempfile"
|
123
122
|
|
124
|
-
|
123
|
+
captured_stdout = Tempfile.new("out")
|
124
|
+
captured_stderr = Tempfile.new("err")
|
125
125
|
|
126
|
-
|
127
|
-
|
128
|
-
|
126
|
+
orig_stdout = $stdout.dup
|
127
|
+
orig_stderr = $stderr.dup
|
128
|
+
$stdout.reopen captured_stdout
|
129
|
+
$stderr.reopen captured_stderr
|
129
130
|
|
130
|
-
|
131
|
+
yield
|
131
132
|
|
132
|
-
|
133
|
-
|
133
|
+
$stdout.rewind
|
134
|
+
$stderr.rewind
|
134
135
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
136
|
+
return captured_stdout.read, captured_stderr.read
|
137
|
+
ensure
|
138
|
+
$stdout.reopen orig_stdout
|
139
|
+
$stderr.reopen orig_stderr
|
139
140
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
end
|
141
|
+
orig_stdout.close
|
142
|
+
orig_stderr.close
|
143
|
+
captured_stdout.close!
|
144
|
+
captured_stderr.close!
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
@@ -337,14 +337,18 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
337
337
|
ruby
|
338
338
|
end
|
339
339
|
|
340
|
-
@git = ENV["GIT"] || "git#{RbConfig::CONFIG[
|
340
|
+
@git = ENV["GIT"] || "git#{RbConfig::CONFIG["EXEEXT"]}"
|
341
341
|
|
342
342
|
Gem.ensure_gem_subdirectories @gemhome
|
343
343
|
Gem.ensure_default_gem_subdirectories @gemhome
|
344
344
|
|
345
345
|
@orig_LOAD_PATH = $LOAD_PATH.dup
|
346
346
|
$LOAD_PATH.map! do |s|
|
347
|
-
expand_path =
|
347
|
+
expand_path = begin
|
348
|
+
File.realpath(s)
|
349
|
+
rescue StandardError
|
350
|
+
File.expand_path(s)
|
351
|
+
end
|
348
352
|
if expand_path != s
|
349
353
|
expand_path.tap(&Gem::UNTAINT)
|
350
354
|
if s.instance_variable_defined?(:@gem_prelude_index)
|
@@ -486,7 +490,7 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
486
490
|
@temp_cred = File.join(@userhome, ".gem", "credentials")
|
487
491
|
FileUtils.mkdir_p File.dirname(@temp_cred)
|
488
492
|
File.write @temp_cred, ":rubygems_api_key: 701229f217cdf23b1344c7b4b54ca97"
|
489
|
-
File.chmod
|
493
|
+
File.chmod 0o600, @temp_cred
|
490
494
|
end
|
491
495
|
|
492
496
|
def credential_teardown
|
@@ -688,11 +692,8 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
688
692
|
# Load a YAML file, the psych 3 way
|
689
693
|
|
690
694
|
def load_yaml_file(file)
|
691
|
-
|
692
|
-
|
693
|
-
else
|
694
|
-
Psych.load_file(file)
|
695
|
-
end
|
695
|
+
require "rubygems/config_file"
|
696
|
+
Gem::ConfigFile.load_with_rubygems_config_hash(File.read(file))
|
696
697
|
end
|
697
698
|
|
698
699
|
def all_spec_names
|
@@ -935,7 +936,7 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
935
936
|
@a1 = quick_gem "a", "1" do |s|
|
936
937
|
s.files = %w[lib/code.rb]
|
937
938
|
s.require_paths = %w[lib]
|
938
|
-
s.date = Gem::Specification::TODAY -
|
939
|
+
s.date = Gem::Specification::TODAY - 86_400
|
939
940
|
s.homepage = "http://a.example.com"
|
940
941
|
s.email = %w[example@example.com example2@example.com]
|
941
942
|
s.authors = %w[Example Example2]
|
@@ -1276,7 +1277,7 @@ Also, a list:
|
|
1276
1277
|
ruby = ENV["RUBY"]
|
1277
1278
|
return ruby if ruby
|
1278
1279
|
ruby = "ruby"
|
1279
|
-
rubyexe = "#{ruby}#{RbConfig::CONFIG[
|
1280
|
+
rubyexe = "#{ruby}#{RbConfig::CONFIG["EXEEXT"]}"
|
1280
1281
|
|
1281
1282
|
3.times do
|
1282
1283
|
if File.exist?(ruby) && File.executable?(ruby) && !File.directory?(ruby)
|
@@ -1327,7 +1328,8 @@ Also, a list:
|
|
1327
1328
|
end
|
1328
1329
|
|
1329
1330
|
def silence_warnings
|
1330
|
-
old_verbose
|
1331
|
+
old_verbose = $VERBOSE
|
1332
|
+
$VERBOSE = false
|
1331
1333
|
yield
|
1332
1334
|
ensure
|
1333
1335
|
$VERBOSE = old_verbose
|
@@ -1351,8 +1353,8 @@ Also, a list:
|
|
1351
1353
|
end
|
1352
1354
|
end
|
1353
1355
|
|
1354
|
-
@@good_rake = "#{rubybin} #{escape_path(__dir__,
|
1355
|
-
@@bad_rake = "#{rubybin} #{escape_path(__dir__,
|
1356
|
+
@@good_rake = "#{rubybin} #{escape_path(__dir__, "good_rake.rb")}"
|
1357
|
+
@@bad_rake = "#{rubybin} #{escape_path(__dir__, "bad_rake.rb")}"
|
1356
1358
|
|
1357
1359
|
##
|
1358
1360
|
# Construct a new Gem::Dependency.
|
@@ -1538,7 +1540,11 @@ Also, a list:
|
|
1538
1540
|
# <tt>test/rubygems/</tt>.
|
1539
1541
|
|
1540
1542
|
def self.cert_path(cert_name)
|
1541
|
-
if 32 ==
|
1543
|
+
if 32 == begin
|
1544
|
+
Time.at(2**32)
|
1545
|
+
rescue StandardError
|
1546
|
+
32
|
1547
|
+
end
|
1542
1548
|
cert_file = "#{__dir__}/#{cert_name}_cert_32.pem"
|
1543
1549
|
|
1544
1550
|
return cert_file if File.exist? cert_file
|
@@ -163,11 +163,11 @@ class Gem::Package::TarTestCase < Gem::TestCase
|
|
163
163
|
data_tgz = util_tar_gz(&block)
|
164
164
|
util_tar do |tar|
|
165
165
|
if spec
|
166
|
-
tar.add_file "metadata.gz",
|
166
|
+
tar.add_file "metadata.gz", 0o444 do |io|
|
167
167
|
io.write util_gzip(spec.to_yaml)
|
168
168
|
end
|
169
169
|
end
|
170
|
-
tar.add_file "data.tar.gz",
|
170
|
+
tar.add_file "data.tar.gz", 0o644 do |io|
|
171
171
|
io.write data_tgz.string
|
172
172
|
end
|
173
173
|
end
|
data/test/rubygems/test_gem.rb
CHANGED
@@ -132,7 +132,7 @@ class TestGem < Gem::TestCase
|
|
132
132
|
end
|
133
133
|
|
134
134
|
def test_self_install_permissions_umask_077
|
135
|
-
umask = File.umask(
|
135
|
+
umask = File.umask(0o77)
|
136
136
|
assert_self_install_permissions
|
137
137
|
ensure
|
138
138
|
File.umask(umask)
|
@@ -152,11 +152,11 @@ class TestGem < Gem::TestCase
|
|
152
152
|
end
|
153
153
|
|
154
154
|
def assert_self_install_permissions(format_executable: false)
|
155
|
-
mask = win_platform? ?
|
155
|
+
mask = win_platform? ? 0o700 : 0o777
|
156
156
|
options = {
|
157
|
-
:dir_mode =>
|
158
|
-
:prog_mode => win_platform? ?
|
159
|
-
:data_mode =>
|
157
|
+
:dir_mode => 0o500,
|
158
|
+
:prog_mode => win_platform? ? 0o410 : 0o510,
|
159
|
+
:data_mode => 0o640,
|
160
160
|
:wrappers => true,
|
161
161
|
:format_executable => format_executable,
|
162
162
|
}
|
@@ -165,7 +165,7 @@ class TestGem < Gem::TestCase
|
|
165
165
|
Dir.mkdir "data"
|
166
166
|
|
167
167
|
File.write "bin/foo", "#!/usr/bin/env ruby\n"
|
168
|
-
File.chmod
|
168
|
+
File.chmod 0o755, "bin/foo"
|
169
169
|
|
170
170
|
File.write "data/foo.txt", "blah\n"
|
171
171
|
|
@@ -201,7 +201,7 @@ class TestGem < Gem::TestCase
|
|
201
201
|
end
|
202
202
|
assert_equal(expected, result)
|
203
203
|
ensure
|
204
|
-
File.chmod(
|
204
|
+
File.chmod(0o755, *Dir.glob(@gemhome + "/gems/**/").map {|path| path.tap(&Gem::UNTAINT) })
|
205
205
|
end
|
206
206
|
|
207
207
|
def test_require_missing
|
@@ -639,12 +639,12 @@ class TestGem < Gem::TestCase
|
|
639
639
|
FileUtils.rm_r @gemhome
|
640
640
|
Gem.use_paths @gemhome
|
641
641
|
|
642
|
-
Gem.ensure_gem_subdirectories @gemhome,
|
642
|
+
Gem.ensure_gem_subdirectories @gemhome, 0o750
|
643
643
|
|
644
644
|
assert_directory_exists File.join(@gemhome, "cache")
|
645
645
|
|
646
|
-
assert_equal
|
647
|
-
assert_equal
|
646
|
+
assert_equal 0o750, File::Stat.new(@gemhome).mode & 0o777
|
647
|
+
assert_equal 0o750, File::Stat.new(File.join(@gemhome, "cache")).mode & 0o777
|
648
648
|
end unless win_platform?
|
649
649
|
|
650
650
|
def test_self_ensure_gem_directories_safe_permissions
|
@@ -655,17 +655,21 @@ class TestGem < Gem::TestCase
|
|
655
655
|
File.umask 0
|
656
656
|
Gem.ensure_gem_subdirectories @gemhome
|
657
657
|
|
658
|
-
assert_equal 0, File::Stat.new(@gemhome).mode &
|
659
|
-
assert_equal 0, File::Stat.new(File.join(@gemhome, "cache")).mode &
|
658
|
+
assert_equal 0, File::Stat.new(@gemhome).mode & 0o02
|
659
|
+
assert_equal 0, File::Stat.new(File.join(@gemhome, "cache")).mode & 0o02
|
660
660
|
ensure
|
661
661
|
File.umask old_umask
|
662
662
|
end unless win_platform?
|
663
663
|
|
664
664
|
def test_self_ensure_gem_directories_missing_parents
|
665
665
|
gemdir = File.join @tempdir, "a/b/c/gemdir"
|
666
|
-
|
666
|
+
begin
|
667
|
+
FileUtils.rm_rf File.join(@tempdir, "a")
|
668
|
+
rescue StandardError
|
669
|
+
nil
|
670
|
+
end
|
667
671
|
refute File.exist?(File.join(@tempdir, "a")),
|
668
|
-
"manually remove #{File.join @tempdir,
|
672
|
+
"manually remove #{File.join @tempdir, "a"}, tests are broken"
|
669
673
|
Gem.use_paths gemdir
|
670
674
|
|
671
675
|
Gem.ensure_gem_subdirectories gemdir
|
@@ -676,34 +680,42 @@ class TestGem < Gem::TestCase
|
|
676
680
|
unless win_platform? || Process.uid.zero? # only for FS that support write protection
|
677
681
|
def test_self_ensure_gem_directories_write_protected
|
678
682
|
gemdir = File.join @tempdir, "egd"
|
679
|
-
|
683
|
+
begin
|
684
|
+
FileUtils.rm_r gemdir
|
685
|
+
rescue StandardError
|
686
|
+
nil
|
687
|
+
end
|
680
688
|
refute File.exist?(gemdir), "manually remove #{gemdir}, tests are broken"
|
681
689
|
FileUtils.mkdir_p gemdir
|
682
|
-
FileUtils.chmod
|
690
|
+
FileUtils.chmod 0o400, gemdir
|
683
691
|
Gem.use_paths gemdir
|
684
692
|
|
685
693
|
Gem.ensure_gem_subdirectories gemdir
|
686
694
|
|
687
695
|
refute File.exist?(util_cache_dir)
|
688
696
|
ensure
|
689
|
-
FileUtils.chmod
|
697
|
+
FileUtils.chmod 0o600, gemdir
|
690
698
|
end
|
691
699
|
|
692
700
|
def test_self_ensure_gem_directories_write_protected_parents
|
693
701
|
parent = File.join(@tempdir, "egd")
|
694
702
|
gemdir = "#{parent}/a/b/c"
|
695
703
|
|
696
|
-
|
704
|
+
begin
|
705
|
+
FileUtils.rm_r parent
|
706
|
+
rescue StandardError
|
707
|
+
nil
|
708
|
+
end
|
697
709
|
refute File.exist?(parent), "manually remove #{parent}, tests are broken"
|
698
710
|
FileUtils.mkdir_p parent
|
699
|
-
FileUtils.chmod
|
711
|
+
FileUtils.chmod 0o400, parent
|
700
712
|
Gem.use_paths(gemdir)
|
701
713
|
|
702
714
|
Gem.ensure_gem_subdirectories gemdir
|
703
715
|
|
704
716
|
refute File.exist? File.join(gemdir, "gems")
|
705
717
|
ensure
|
706
|
-
FileUtils.chmod
|
718
|
+
FileUtils.chmod 0o600, parent
|
707
719
|
end
|
708
720
|
|
709
721
|
def test_self_ensure_gem_directories_non_existent_paths
|
@@ -965,11 +977,11 @@ class TestGem < Gem::TestCase
|
|
965
977
|
pend "chmod not supported" if Gem.win_platform?
|
966
978
|
|
967
979
|
begin
|
968
|
-
File.chmod
|
980
|
+
File.chmod 0o444, "test"
|
969
981
|
|
970
982
|
assert_equal ["\xCF", "\x80"], Gem.read_binary("test").chars.to_a
|
971
983
|
ensure
|
972
|
-
File.chmod
|
984
|
+
File.chmod 0o644, "test"
|
973
985
|
end
|
974
986
|
end
|
975
987
|
|
@@ -1030,7 +1042,8 @@ class TestGem < Gem::TestCase
|
|
1030
1042
|
end
|
1031
1043
|
|
1032
1044
|
def test_self_ruby_api_version
|
1033
|
-
orig_ruby_version
|
1045
|
+
orig_ruby_version = RbConfig::CONFIG["ruby_version"]
|
1046
|
+
RbConfig::CONFIG["ruby_version"] = "1.2.3"
|
1034
1047
|
|
1035
1048
|
Gem.instance_variable_set :@ruby_api_version, nil
|
1036
1049
|
|
@@ -1053,7 +1066,7 @@ class TestGem < Gem::TestCase
|
|
1053
1066
|
end
|
1054
1067
|
|
1055
1068
|
def test_self_ruby_version_with_non_mri_implementations
|
1056
|
-
util_set_RUBY_VERSION "2.5.0", 0,
|
1069
|
+
util_set_RUBY_VERSION "2.5.0", 0, 60_928, "jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.171-b11 on 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11 [linux-x86_64]"
|
1057
1070
|
|
1058
1071
|
assert_equal Gem::Version.new("2.5.0"), Gem.ruby_version
|
1059
1072
|
ensure
|
@@ -1061,7 +1074,7 @@ class TestGem < Gem::TestCase
|
|
1061
1074
|
end
|
1062
1075
|
|
1063
1076
|
def test_self_ruby_version_with_svn_prerelease
|
1064
|
-
util_set_RUBY_VERSION "2.6.0", -1,
|
1077
|
+
util_set_RUBY_VERSION "2.6.0", -1, 63_539, "ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-linux]"
|
1065
1078
|
|
1066
1079
|
assert_equal Gem::Version.new("2.6.0.preview2"), Gem.ruby_version
|
1067
1080
|
ensure
|
@@ -1077,7 +1090,7 @@ class TestGem < Gem::TestCase
|
|
1077
1090
|
end
|
1078
1091
|
|
1079
1092
|
def test_self_ruby_version_with_non_mri_implementations_with_mri_prerelase_compatibility
|
1080
|
-
util_set_RUBY_VERSION "2.6.0", -1,
|
1093
|
+
util_set_RUBY_VERSION "2.6.0", -1, 63_539, "weirdjruby 9.2.0.0 (2.6.0preview2) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.171-b11 on 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11 [linux-x86_64]", "weirdjruby", "9.2.0.0"
|
1081
1094
|
|
1082
1095
|
assert_equal Gem::Version.new("2.6.0.preview2"), Gem.ruby_version
|
1083
1096
|
ensure
|
@@ -1085,7 +1098,7 @@ class TestGem < Gem::TestCase
|
|
1085
1098
|
end
|
1086
1099
|
|
1087
1100
|
def test_self_ruby_version_with_svn_trunk
|
1088
|
-
util_set_RUBY_VERSION "1.9.2", -1,
|
1101
|
+
util_set_RUBY_VERSION "1.9.2", -1, 23_493, "ruby 1.9.2dev (2009-05-20 trunk 23493) [x86_64-linux]"
|
1089
1102
|
|
1090
1103
|
assert_equal Gem::Version.new("1.9.2.dev"), Gem.ruby_version
|
1091
1104
|
ensure
|
@@ -1503,19 +1516,31 @@ class TestGem < Gem::TestCase
|
|
1503
1516
|
|
1504
1517
|
def test_load_env_plugins
|
1505
1518
|
with_plugin("load") { Gem.load_env_plugins }
|
1506
|
-
|
1519
|
+
begin
|
1520
|
+
assert_equal :loaded, TEST_PLUGIN_LOAD
|
1521
|
+
rescue StandardError
|
1522
|
+
nil
|
1523
|
+
end
|
1507
1524
|
|
1508
1525
|
util_remove_interrupt_command
|
1509
1526
|
|
1510
1527
|
# Should attempt to cause a StandardError
|
1511
1528
|
with_plugin("standarderror") { Gem.load_env_plugins }
|
1512
|
-
|
1529
|
+
begin
|
1530
|
+
assert_equal :loaded, TEST_PLUGIN_STANDARDERROR
|
1531
|
+
rescue StandardError
|
1532
|
+
nil
|
1533
|
+
end
|
1513
1534
|
|
1514
1535
|
util_remove_interrupt_command
|
1515
1536
|
|
1516
1537
|
# Should attempt to cause an Exception
|
1517
1538
|
with_plugin("exception") { Gem.load_env_plugins }
|
1518
|
-
|
1539
|
+
begin
|
1540
|
+
assert_equal :loaded, TEST_PLUGIN_EXCEPTION
|
1541
|
+
rescue StandardError
|
1542
|
+
nil
|
1543
|
+
end
|
1519
1544
|
end
|
1520
1545
|
|
1521
1546
|
def test_gem_path_ordering
|
@@ -56,7 +56,9 @@ class TestGemCommand < Gem::TestCase
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_self_extra_args
|
59
|
-
verbose
|
59
|
+
verbose = $VERBOSE
|
60
|
+
$VERBOSE = nil
|
61
|
+
separator = $;
|
60
62
|
extra_args = Gem::Command.extra_args
|
61
63
|
|
62
64
|
Gem::Command.extra_args = %w[--all]
|
@@ -199,7 +199,8 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
199
199
|
|
200
200
|
error = @ui.error.split "\n"
|
201
201
|
assert_equal "WARNING: licenses is empty, but is recommended. Use a license identifier from", error.shift
|
202
|
-
assert_equal "http://spdx.org/licenses or 'Nonstandard' for a nonstandard license
|
202
|
+
assert_equal "http://spdx.org/licenses or 'Nonstandard' for a nonstandard license,", error.shift
|
203
|
+
assert_equal "or set it to nil if you don't want to specify a license.", error.shift
|
203
204
|
assert_equal "WARNING: See https://guides.rubygems.org/specification-reference/ for help", error.shift
|
204
205
|
assert_equal [], error
|
205
206
|
|
@@ -129,9 +129,9 @@ Added '/CN=alternate/DC=example'
|
|
129
129
|
output.shift
|
130
130
|
assert_equal "Please repeat the passphrase for your Private Key: ",
|
131
131
|
output.shift
|
132
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
132
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
133
133
|
output.shift
|
134
|
-
assert_equal "Private Key: #{File.join @tempdir,
|
134
|
+
assert_equal "Private Key: #{File.join @tempdir, "gem-private_key.pem"}",
|
135
135
|
output.shift
|
136
136
|
|
137
137
|
assert_equal "Don't forget to move the key file to somewhere private!",
|
@@ -161,9 +161,9 @@ Added '/CN=alternate/DC=example'
|
|
161
161
|
output.shift
|
162
162
|
assert_equal "Please repeat the passphrase for your Private Key: ",
|
163
163
|
output.shift
|
164
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
164
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
165
165
|
output.shift
|
166
|
-
assert_equal "Private Key: #{File.join @tempdir,
|
166
|
+
assert_equal "Private Key: #{File.join @tempdir, "gem-private_key.pem"}",
|
167
167
|
output.shift
|
168
168
|
|
169
169
|
assert_equal "Don't forget to move the key file to somewhere private!",
|
@@ -221,9 +221,9 @@ Added '/CN=alternate/DC=example'
|
|
221
221
|
output.shift
|
222
222
|
assert_equal "Please repeat the passphrase for your Private Key: ",
|
223
223
|
output.shift
|
224
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
224
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
225
225
|
output.shift
|
226
|
-
assert_equal "Private Key: #{File.join @tempdir,
|
226
|
+
assert_equal "Private Key: #{File.join @tempdir, "gem-private_key.pem"}",
|
227
227
|
output.shift
|
228
228
|
|
229
229
|
assert_equal "Don't forget to move the key file to somewhere private!",
|
@@ -284,7 +284,7 @@ Added '/CN=alternate/DC=example'
|
|
284
284
|
|
285
285
|
output = @ui.output.split "\n"
|
286
286
|
|
287
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
287
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
288
288
|
output.shift
|
289
289
|
|
290
290
|
assert_empty output
|
@@ -306,7 +306,7 @@ Added '/CN=alternate/DC=example'
|
|
306
306
|
|
307
307
|
output = @ui.output.split "\n"
|
308
308
|
|
309
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
309
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
310
310
|
output.shift
|
311
311
|
|
312
312
|
assert_empty output
|
@@ -327,7 +327,7 @@ Added '/CN=alternate/DC=example'
|
|
327
327
|
|
328
328
|
output = @ui.output.split "\n"
|
329
329
|
|
330
|
-
assert_equal "Certificate: #{File.join @tempdir,
|
330
|
+
assert_equal "Certificate: #{File.join @tempdir, "gem-public_cert.pem"}",
|
331
331
|
output.shift
|
332
332
|
|
333
333
|
assert_empty output
|
@@ -476,7 +476,7 @@ Removed '/CN=alternate/DC=example'
|
|
476
476
|
|
477
477
|
def test_execute_sign
|
478
478
|
path = File.join @tempdir, "cert.pem"
|
479
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
479
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
480
480
|
|
481
481
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
482
482
|
|
@@ -498,14 +498,14 @@ Removed '/CN=alternate/DC=example'
|
|
498
498
|
|
499
499
|
assert_equal "/CN=nobody/DC=example", cert.issuer.to_s
|
500
500
|
|
501
|
-
mask =
|
501
|
+
mask = 0o100600 & (~File.umask)
|
502
502
|
|
503
503
|
assert_equal mask, File.stat(path).mode unless win_platform?
|
504
504
|
end
|
505
505
|
|
506
506
|
def test_execute_sign_encrypted_key
|
507
507
|
path = File.join @tempdir, "cert.pem"
|
508
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
508
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
509
509
|
|
510
510
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
511
511
|
|
@@ -527,7 +527,7 @@ Removed '/CN=alternate/DC=example'
|
|
527
527
|
|
528
528
|
assert_equal "/CN=nobody/DC=example", cert.issuer.to_s
|
529
529
|
|
530
|
-
mask =
|
530
|
+
mask = 0o100600 & (~File.umask)
|
531
531
|
|
532
532
|
assert_equal mask, File.stat(path).mode unless win_platform?
|
533
533
|
end
|
@@ -542,7 +542,7 @@ Removed '/CN=alternate/DC=example'
|
|
542
542
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
543
543
|
|
544
544
|
path = File.join @tempdir, "cert.pem"
|
545
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
545
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
546
546
|
|
547
547
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
548
548
|
|
@@ -559,7 +559,7 @@ Removed '/CN=alternate/DC=example'
|
|
559
559
|
|
560
560
|
assert_equal "/CN=nobody/DC=example", cert.issuer.to_s
|
561
561
|
|
562
|
-
mask =
|
562
|
+
mask = 0o100600 & (~File.umask)
|
563
563
|
|
564
564
|
assert_equal mask, File.stat(path).mode unless win_platform?
|
565
565
|
end
|
@@ -568,13 +568,13 @@ Removed '/CN=alternate/DC=example'
|
|
568
568
|
FileUtils.mkdir_p File.join(Gem.user_home, ".gem")
|
569
569
|
|
570
570
|
private_key_path = File.join Gem.user_home, ".gem", "gem-private_key.pem"
|
571
|
-
Gem::Security.write ENCRYPTED_PRIVATE_KEY, private_key_path,
|
571
|
+
Gem::Security.write ENCRYPTED_PRIVATE_KEY, private_key_path, 0o600, PRIVATE_KEY_PASSPHRASE
|
572
572
|
|
573
573
|
public_cert_path = File.join Gem.user_home, ".gem", "gem-public_cert.pem"
|
574
574
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
575
575
|
|
576
576
|
path = File.join @tempdir, "cert.pem"
|
577
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
577
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
578
578
|
|
579
579
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
580
580
|
|
@@ -591,7 +591,7 @@ Removed '/CN=alternate/DC=example'
|
|
591
591
|
|
592
592
|
assert_equal "/CN=nobody/DC=example", cert.issuer.to_s
|
593
593
|
|
594
|
-
mask =
|
594
|
+
mask = 0o100600 & (~File.umask)
|
595
595
|
|
596
596
|
assert_equal mask, File.stat(path).mode unless win_platform?
|
597
597
|
end
|
@@ -603,7 +603,7 @@ Removed '/CN=alternate/DC=example'
|
|
603
603
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
604
604
|
|
605
605
|
path = File.join @tempdir, "cert.pem"
|
606
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
606
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
607
607
|
|
608
608
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
609
609
|
|
@@ -631,7 +631,7 @@ ERROR: --certificate not specified and ~/.gem/gem-public_cert.pem does not exis
|
|
631
631
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
632
632
|
|
633
633
|
path = File.join @tempdir, "cert.pem"
|
634
|
-
Gem::Security.write ALTERNATE_CERT, path,
|
634
|
+
Gem::Security.write ALTERNATE_CERT, path, 0o600
|
635
635
|
|
636
636
|
assert_equal "/CN=alternate/DC=example", ALTERNATE_CERT.issuer.to_s
|
637
637
|
|
@@ -657,7 +657,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
|
|
657
657
|
Dir.mkdir gem_path
|
658
658
|
|
659
659
|
path = File.join @tempdir, "cert.pem"
|
660
|
-
Gem::Security.write EXPIRED_PUBLIC_CERT, path,
|
660
|
+
Gem::Security.write EXPIRED_PUBLIC_CERT, path, 0o600
|
661
661
|
|
662
662
|
assert_equal "/CN=nobody/DC=example", EXPIRED_PUBLIC_CERT.issuer.to_s
|
663
663
|
|
@@ -689,7 +689,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
|
|
689
689
|
Dir.mkdir gem_path
|
690
690
|
|
691
691
|
path = File.join @tempdir, "cert.pem"
|
692
|
-
Gem::Security.write EXPIRED_PUBLIC_CERT, path,
|
692
|
+
Gem::Security.write EXPIRED_PUBLIC_CERT, path, 0o600
|
693
693
|
|
694
694
|
assert_equal "/CN=nobody/DC=example", EXPIRED_PUBLIC_CERT.issuer.to_s
|
695
695
|
|
@@ -166,7 +166,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
|
|
166
166
|
end
|
167
167
|
|
168
168
|
def test_execute_all_user_no_sudo
|
169
|
-
FileUtils.chmod
|
169
|
+
FileUtils.chmod 0o555, @gemhome
|
170
170
|
|
171
171
|
@a_1_1, = util_gem "a", "1.1"
|
172
172
|
@a_1_1 = install_gem @a_1_1, :user_install => true # pick up user install path
|
@@ -183,7 +183,7 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
|
|
183
183
|
assert_path_exist @a_1.gem_dir
|
184
184
|
assert_path_exist @a_1_1.gem_dir
|
185
185
|
ensure
|
186
|
-
FileUtils.chmod
|
186
|
+
FileUtils.chmod 0o755, @gemhome
|
187
187
|
end unless win_platform? || Process.uid.zero?
|
188
188
|
|
189
189
|
def test_execute_dry_run
|
@@ -12,7 +12,8 @@ class TestGemCommandsEnvironmentCommand < Gem::TestCase
|
|
12
12
|
|
13
13
|
def test_execute
|
14
14
|
orig_sources = Gem.sources.dup
|
15
|
-
orig_path
|
15
|
+
orig_path = ENV["PATH"]
|
16
|
+
ENV["PATH"] = %w[/usr/local/bin /usr/bin /bin].join(File::PATH_SEPARATOR)
|
16
17
|
Gem.sources.replace %w[http://gems.example.com]
|
17
18
|
Gem.configuration["gemcutter_key"] = "blah"
|
18
19
|
|
@@ -731,7 +731,11 @@ class TestGemCommandsExecCommand < Gem::TestCase
|
|
731
731
|
assert_includes @ui.output, "a (2)\n"
|
732
732
|
assert_includes @ui.output, "b (2)\n"
|
733
733
|
|
734
|
-
|
734
|
+
begin
|
735
|
+
invoke "gem", "uninstall", "--verbose", "-x", "a"
|
736
|
+
rescue StandardError
|
737
|
+
nil
|
738
|
+
end
|
735
739
|
refute_includes @ui.output, "running gem exec with"
|
736
740
|
assert_includes @ui.output, "Successfully uninstalled a-2\n"
|
737
741
|
|
@@ -205,8 +205,8 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
|
|
205
205
|
use_ui @ui do
|
206
206
|
orig_dir = Dir.pwd
|
207
207
|
begin
|
208
|
-
FileUtils.chmod
|
209
|
-
FileUtils.chmod
|
208
|
+
FileUtils.chmod 0o755, @userhome
|
209
|
+
FileUtils.chmod 0o555, @gemhome
|
210
210
|
|
211
211
|
Dir.chdir @tempdir
|
212
212
|
assert_raise Gem::FilePermissionError do
|
@@ -214,7 +214,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
|
|
214
214
|
end
|
215
215
|
ensure
|
216
216
|
Dir.chdir orig_dir
|
217
|
-
FileUtils.chmod
|
217
|
+
FileUtils.chmod 0o755, @gemhome
|
218
218
|
end
|
219
219
|
end
|
220
220
|
end
|
@@ -22,20 +22,23 @@ class TestGemCommandsOpenCommand < Gem::TestCase
|
|
22
22
|
|
23
23
|
def test_execute
|
24
24
|
@cmd.options[:args] = %w[foo]
|
25
|
-
@cmd.options[:editor] =
|
25
|
+
@cmd.options[:editor] = (ruby_with_rubygems_in_load_path + ["-e", "puts(ARGV,Dir.pwd)", "--"]).join(" ")
|
26
26
|
|
27
27
|
gem "foo", "1.0.0"
|
28
28
|
spec = gem "foo", "1.0.1"
|
29
29
|
|
30
30
|
assert_nothing_raised Gem::MockGemUi::TermError do
|
31
|
-
|
31
|
+
stdout, stderr = capture_subprocess_io do
|
32
32
|
use_ui @ui do
|
33
33
|
@cmd.execute
|
34
34
|
end
|
35
35
|
end
|
36
|
+
assert_equal [spec.full_gem_path, spec.full_gem_path], stdout.split("\n")
|
37
|
+
assert_equal "", stderr
|
36
38
|
end
|
37
39
|
|
38
40
|
assert_equal "", @ui.error
|
41
|
+
assert_equal "", @ui.output
|
39
42
|
end
|
40
43
|
|
41
44
|
def test_wrong_version
|