summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_dependency_installer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_dependency_installer.rb')
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb94
1 files changed, 47 insertions, 47 deletions
diff --git a/test/rubygems/test_gem_dependency_installer.rb b/test/rubygems/test_gem_dependency_installer.rb
index 067eb309b1..5e59539ae4 100644
--- a/test/rubygems/test_gem_dependency_installer.rb
+++ b/test/rubygems/test_gem_dependency_installer.rb
@@ -156,7 +156,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name },
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name),
"sanity check"
Dir.chdir @tempdir do
@@ -164,7 +164,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "e"
end
- assert_equal %w[a-1 e-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 e-1], inst.installed_gems.map(&:full_name)
end
def test_install_cache_dir
@@ -181,7 +181,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 b-1], inst.installed_gems.map(&:full_name)
assert File.exist? File.join(@gemhome, "cache", @a1.file_name)
assert File.exist? File.join(@gemhome, "cache", @b1.file_name)
@@ -206,7 +206,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "a", req("= 2")
end
- assert_equal %w[a-2], inst.installed_gems.map {|s| s.full_name },
+ assert_equal %w[a-2], inst.installed_gems.map(&:full_name),
"sanity check"
FileUtils.rm File.join(@tempdir, a2.file_name)
@@ -217,7 +217,7 @@ class TestGemDependencyInstaller < Gem::TestCase
end
assert_equal %w[a-2 b-1], Gem::Specification.map(&:full_name)
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name)
end
# This asserts that if a gem's dependency is satisfied by an
@@ -254,7 +254,7 @@ class TestGemDependencyInstaller < Gem::TestCase
end
assert_equal %w[a-2 b-1], Gem::Specification.map(&:full_name)
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name)
end
def test_install_dependency
@@ -277,7 +277,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 b-1], inst.installed_gems.map(&:full_name)
assert done_installing_ran, "post installs hook was not run"
end
@@ -297,7 +297,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[a-1 aa-1 b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 aa-1 b-1], inst.installed_gems.map(&:full_name)
end
def test_install_dependency_development_deep
@@ -317,7 +317,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "d"
end
- assert_equal %w[a-1 aa-1 b-1 c-1 d-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 aa-1 b-1 c-1 d-1], inst.installed_gems.map(&:full_name)
end
def test_install_dependency_development_shallow
@@ -337,7 +337,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "d"
end
- assert_equal %w[c-1 d-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[c-1 d-1], inst.installed_gems.map(&:full_name)
end
def test_install_dependency_existing
@@ -353,7 +353,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name)
end
def test_install_dependency_existing_extension
@@ -390,7 +390,7 @@ class TestGemDependencyInstaller < Gem::TestCase
Dir.chdir pwd
end
- assert_equal %w[f-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[f-1], inst.installed_gems.map(&:full_name)
assert_path_exist e1.extension_dir
end
@@ -410,7 +410,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "f"
end
- assert_equal %w[f-2], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[f-2], inst.installed_gems.map(&:full_name)
end
def test_install_local
@@ -424,7 +424,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "a-1.gem"
end
- assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1], inst.installed_gems.map(&:full_name)
end
def test_install_local_prerelease
@@ -438,7 +438,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "a-1.a.gem"
end
- assert_equal %w[a-1.a], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1.a], inst.installed_gems.map(&:full_name)
end
def test_install_local_dependency
@@ -454,7 +454,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b-1.gem"
end
- assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 b-1], inst.installed_gems.map(&:full_name)
end
def test_install_local_dependency_installed
@@ -472,7 +472,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b-1.gem"
end
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name)
end
def test_install_local_subdir
@@ -485,7 +485,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "gems/a-1.gem"
end
- assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1], inst.installed_gems.map(&:full_name)
end
def test_install_minimal_deps
@@ -511,7 +511,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b", req("= 1")
end
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name },
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name),
"sanity check"
Dir.chdir @tempdir do
@@ -519,7 +519,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "e"
end
- assert_equal %w[a-1 e-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 e-1], inst.installed_gems.map(&:full_name)
end
def test_install_no_minimal_deps
@@ -545,7 +545,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b", req("= 1")
end
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name },
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name),
"sanity check"
Dir.chdir @tempdir do
@@ -553,7 +553,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "e"
end
- assert_equal %w[a-1 b-2 e-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 b-2 e-1], inst.installed_gems.map(&:full_name)
end
def test_install_no_document
@@ -603,7 +603,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name)
end
def test_install_build_args
@@ -632,7 +632,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name)
end
def test_install_install_dir
@@ -653,7 +653,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 b-1], inst.installed_gems.map(&:full_name)
assert File.exist?(File.join(gemhome2, "specifications", @a1.spec_name))
assert File.exist?(File.join(gemhome2, "cache", @a1.file_name))
@@ -677,7 +677,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 b-1], inst.installed_gems.map(&:full_name)
a1, b1 = inst.installed_gems
assert_equal a1.spec_file, a1.loaded_from
@@ -701,7 +701,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[a-1 b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1 b-1], inst.installed_gems.map(&:full_name)
end
def test_install_domain_local
@@ -720,7 +720,7 @@ class TestGemDependencyInstaller < Gem::TestCase
assert_equal expected, e.message
end
- assert_equal [], inst.installed_gems.map {|s| s.full_name }
+ assert_equal [], inst.installed_gems.map(&:full_name)
end
def test_install_domain_remote
@@ -736,7 +736,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst = Gem::DependencyInstaller.new :domain => :remote
inst.install "a"
- assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1], inst.installed_gems.map(&:full_name)
end
def test_install_dual_repository
@@ -753,7 +753,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "a"
end
- assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name },
+ assert_equal %w[a-1], inst.installed_gems.map(&:full_name),
"sanity check"
ENV["GEM_HOME"] = @gemhome
@@ -765,7 +765,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "b"
end
- assert_equal %w[b-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[b-1], inst.installed_gems.map(&:full_name)
end
def test_install_reinstall
@@ -800,7 +800,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install "a"
end
- assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1], inst.installed_gems.map(&:full_name)
end
def test_install_remote_dep
@@ -820,7 +820,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst.install dep
end
- assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1], inst.installed_gems.map(&:full_name)
end
def test_install_remote_platform_newer
@@ -853,7 +853,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst = Gem::DependencyInstaller.new :domain => :remote
inst.install "a"
- assert_equal %w[a-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1], inst.installed_gems.map(&:full_name)
end
def test_install_platform_is_ignored_when_a_file_is_specified
@@ -864,7 +864,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst = Gem::DependencyInstaller.new :domain => :local
inst.install a_gem
- assert_equal %w[a-1-cpu-other_platform-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[a-1-cpu-other_platform-1], inst.installed_gems.map(&:full_name)
end
require "rubygems/openssl"
@@ -873,10 +873,10 @@ class TestGemDependencyInstaller < Gem::TestCase
def test_install_security_policy
util_setup_gems
- data = File.open(@a1_gem, "rb") {|f| f.read }
+ data = File.open(@a1_gem, "rb", &:read)
@fetcher.data["http://gems.example.com/gems/a-1.gem"] = data
- data = File.open(@b1_gem, "rb") {|f| f.read }
+ data = File.open(@b1_gem, "rb", &:read)
@fetcher.data["http://gems.example.com/gems/b-1.gem"] = data
policy = Gem::Security::HighSecurity
@@ -889,7 +889,7 @@ class TestGemDependencyInstaller < Gem::TestCase
assert_equal "unsigned gems are not allowed by the High Security policy",
e.message
- assert_equal %w[], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[], inst.installed_gems.map(&:full_name)
end
end
@@ -911,32 +911,32 @@ class TestGemDependencyInstaller < Gem::TestCase
def test_install_version
util_setup_d
- data = File.open(@d2_gem, "rb") {|f| f.read }
+ data = File.open(@d2_gem, "rb", &:read)
@fetcher.data["http://gems.example.com/gems/d-2.gem"] = data
- data = File.open(@d1_gem, "rb") {|f| f.read }
+ data = File.open(@d1_gem, "rb", &:read)
@fetcher.data["http://gems.example.com/gems/d-1.gem"] = data
inst = Gem::DependencyInstaller.new
inst.install "d", "= 1"
- assert_equal %w[d-1], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[d-1], inst.installed_gems.map(&:full_name)
end
def test_install_version_default
util_setup_d
- data = File.open(@d2_gem, "rb") {|f| f.read }
+ data = File.open(@d2_gem, "rb", &:read)
@fetcher.data["http://gems.example.com/gems/d-2.gem"] = data
- data = File.open(@d1_gem, "rb") {|f| f.read }
+ data = File.open(@d1_gem, "rb", &:read)
@fetcher.data["http://gems.example.com/gems/d-1.gem"] = data
inst = Gem::DependencyInstaller.new
inst.install "d"
- assert_equal %w[d-2], inst.installed_gems.map {|s| s.full_name }
+ assert_equal %w[d-2], inst.installed_gems.map(&:full_name)
end
def test_install_legacy_spec_with_nil_required_ruby_version
@@ -1109,7 +1109,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst = Gem::DependencyInstaller.new
request_set = inst.resolve_dependencies "b", req(">= 0")
- requests = request_set.sorted_requests.map {|req| req.full_name }
+ requests = request_set.sorted_requests.map(&:full_name)
assert_equal %w[a-1 b-1], requests
end
@@ -1123,7 +1123,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst = Gem::DependencyInstaller.new :ignore_dependencies => true
request_set = inst.resolve_dependencies "b", req(">= 0")
- requests = request_set.sorted_requests.map {|req| req.full_name }
+ requests = request_set.sorted_requests.map(&:full_name)
assert request_set.ignore_dependencies
@@ -1140,7 +1140,7 @@ class TestGemDependencyInstaller < Gem::TestCase
inst = Gem::DependencyInstaller.new
request_set = inst.resolve_dependencies "a-1.gem", req(">= 0")
- requests = request_set.sorted_requests.map {|req| req.full_name }
+ requests = request_set.sorted_requests.map(&:full_name)
assert_equal %w[a-1], requests
end