summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-12-21 19:37:04 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 14:13:29 +0900
commit53b548f4384f1efb647baf9fc3290dc673e05403 (patch)
tree7a1c7d13a0ffb979b34ccefaa972acf2584fa76c /test
parent6438c5848d1f663ecd135903a2a323d6d6006838 (diff)
[rubygems/rubygems] Install existing gems as regular gems
https://github.com/rubygems/rubygems/commit/a0880d78a8
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3092
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb23
1 files changed, 9 insertions, 14 deletions
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index 7d33c0c6d7..72f6a21cf7 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -70,18 +70,13 @@ class TestGemCommandsSetupCommand < Gem::TestCase
io.puts gemspec.to_ruby
end
- FileUtils.mkdir_p File.join(Gem.default_dir, "specifications")
+ spec_fetcher do |fetcher|
+ fetcher.download "bundler", "1.15.4"
- open(File.join(Gem.default_dir, "specifications", "bundler-#{BUNDLER_VERS}.gemspec"), 'w') do |io|
- io.puts "# bundler-#{BUNDLER_VERS}"
- end
+ fetcher.gem "bundler", BUNDLER_VERS
- open(File.join(Gem.default_dir, "specifications", "bundler-audit-1.0.0.gemspec"), 'w') do |io|
- io.puts '# bundler-audit'
+ fetcher.gem "bundler-audit", "1.0.0"
end
-
- FileUtils.mkdir_p 'default/gems/bundler-1.15.4'
- FileUtils.mkdir_p 'default/gems/bundler-audit-1.0.0'
end
def gem_install(name)
@@ -249,14 +244,14 @@ class TestGemCommandsSetupCommand < Gem::TestCase
assert_path_exists File.join(default_dir, "bundler-#{BUNDLER_VERS}.gemspec")
# expect to not remove bundler-* gemspecs.
- assert_path_exists File.join(Gem.default_dir, "specifications", "bundler-audit-1.0.0.gemspec")
+ assert_path_exists File.join(Gem.dir, "specifications", "bundler-audit-1.0.0.gemspec")
# expect to remove normal gem that was same version. because it's promoted default gems.
- refute_path_exists File.join(Gem.default_dir, "specifications", "bundler-#{BUNDLER_VERS}.gemspec")
+ refute_path_exists File.join(Gem.dir, "specifications", "bundler-#{BUNDLER_VERS}.gemspec")
- assert_path_exists "default/gems/bundler-#{BUNDLER_VERS}"
- assert_path_exists 'default/gems/bundler-1.15.4'
- assert_path_exists 'default/gems/bundler-audit-1.0.0'
+ assert_path_exists "#{Gem.dir}/gems/bundler-#{BUNDLER_VERS}"
+ assert_path_exists "#{Gem.dir}/gems/bundler-1.15.4"
+ assert_path_exists "#{Gem.dir}/gems/bundler-audit-1.0.0"
end
def test_install_default_bundler_gem_with_force_flag