diff options
Diffstat (limited to 'test/rubygems/test_gem_dependency_installer.rb')
-rw-r--r-- | test/rubygems/test_gem_dependency_installer.rb | 94 |
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 e7a72c1ef8..91d7a47189 100644 --- a/test/rubygems/test_gem_dependency_installer.rb +++ b/test/rubygems/test_gem_dependency_installer.rb @@ -157,7 +157,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 {|s| s.full_name }, 'sanity check' Dir.chdir @tempdir do @@ -165,7 +165,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 {|s| s.full_name } end def test_install_cache_dir @@ -182,7 +182,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 {|s| s.full_name } assert File.exist? File.join(@gemhome, "cache", @a1.file_name) assert File.exist? File.join(@gemhome, "cache", @b1.file_name) @@ -207,7 +207,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 {|s| s.full_name }, 'sanity check' FileUtils.rm File.join(@tempdir, a2.file_name) @@ -218,7 +218,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 {|s| s.full_name } end # This asserts that if a gem's dependency is satisfied by an @@ -255,7 +255,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 {|s| s.full_name } end def test_install_dependency @@ -278,7 +278,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 {|s| s.full_name } assert done_installing_ran, 'post installs hook was not run' end @@ -300,7 +300,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 {|s| s.full_name } end def test_install_dependency_development_deep @@ -322,7 +322,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 {|s| s.full_name } end def test_install_dependency_development_shallow @@ -344,7 +344,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 {|s| s.full_name } end def test_install_dependency_existing @@ -360,7 +360,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 {|s| s.full_name } end def test_install_dependency_existing_extension @@ -397,7 +397,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 {|s| s.full_name } assert_path_exists e1.extension_dir end @@ -417,7 +417,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 {|s| s.full_name } end def test_install_local @@ -431,7 +431,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 {|s| s.full_name } end def test_install_local_prerelease @@ -445,7 +445,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 {|s| s.full_name } end def test_install_local_dependency @@ -461,7 +461,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 {|s| s.full_name } end def test_install_local_dependency_installed @@ -479,7 +479,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 {|s| s.full_name } end def test_install_local_subdir @@ -492,7 +492,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 {|s| s.full_name } end def test_install_minimal_deps @@ -518,7 +518,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 {|s| s.full_name }, 'sanity check' Dir.chdir @tempdir do @@ -526,7 +526,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 {|s| s.full_name } end def test_install_no_document @@ -576,7 +576,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 {|s| s.full_name } end def test_install_build_args @@ -606,7 +606,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 {|s| s.full_name } end def test_install_install_dir @@ -627,7 +627,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 {|s| s.full_name } assert File.exist?(File.join(gemhome2, 'specifications', @a1.spec_name)) assert File.exist?(File.join(gemhome2, 'cache', @a1.file_name)) @@ -651,7 +651,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 {|s| s.full_name } a1, b1 = inst.installed_gems assert_equal a1.spec_file, a1.loaded_from @@ -675,7 +675,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 {|s| s.full_name } end def test_install_domain_local @@ -694,7 +694,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 {|s| s.full_name } end def test_install_domain_remote @@ -710,7 +710,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 {|s| s.full_name } end def test_install_dual_repository @@ -727,7 +727,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 {|s| s.full_name }, 'sanity check' ENV['GEM_HOME'] = @gemhome @@ -739,7 +739,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 {|s| s.full_name } end def test_install_reinstall @@ -774,7 +774,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 {|s| s.full_name } end def test_install_remote_dep @@ -794,7 +794,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 {|s| s.full_name } end def test_install_remote_platform_newer @@ -827,7 +827,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 {|s| s.full_name } end def test_install_platform_is_ignored_when_a_file_is_specified @@ -838,17 +838,17 @@ 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 {|s| s.full_name } end if defined? OpenSSL def test_install_security_policy util_setup_gems - data = File.open(@a1_gem, 'rb') { |f| f.read } + data = File.open(@a1_gem, 'rb') {|f| f.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') {|f| f.read } @fetcher.data['http://gems.example.com/gems/b-1.gem'] = data policy = Gem::Security::HighSecurity @@ -861,7 +861,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 {|s| s.full_name } end end @@ -883,32 +883,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') {|f| f.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') {|f| f.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 {|s| s.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') {|f| f.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') {|f| f.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 {|s| s.full_name } end def test_find_gems_gems_with_sources @@ -972,8 +972,8 @@ class TestGemDependencyInstaller < Gem::TestCase releases = set.all_specs - assert releases.any? { |s| s.name == 'a' and s.version.to_s == '1' } - refute releases.any? { |s| s.name == 'a' and s.version.to_s == '1.a' } + assert releases.any? {|s| s.name == 'a' and s.version.to_s == '1' } + refute releases.any? {|s| s.name == 'a' and s.version.to_s == '1.a' } dependency.prerelease = true @@ -1031,7 +1031,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 {|req| req.full_name } assert_equal %w[a-1 b-1], requests end @@ -1045,7 +1045,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 {|req| req.full_name } assert request_set.ignore_dependencies @@ -1062,7 +1062,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 {|req| req.full_name } assert_equal %w[a-1], requests end |