summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_path_support.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_path_support.rb')
-rw-r--r--test/rubygems/test_gem_path_support.rb35
1 files changed, 16 insertions, 19 deletions
diff --git a/test/rubygems/test_gem_path_support.rb b/test/rubygems/test_gem_path_support.rb
index 88a3cc29b9..8720bcf858 100644
--- a/test/rubygems/test_gem_path_support.rb
+++ b/test/rubygems/test_gem_path_support.rb
@@ -1,7 +1,8 @@
# frozen_string_literal: true
-require_relative 'helper'
-require 'rubygems'
-require 'fileutils'
+
+require_relative "helper"
+require "rubygems"
+require "fileutils"
class TestGemPathSupport < Gem::TestCase
def setup
@@ -16,7 +17,7 @@ class TestGemPathSupport < Gem::TestCase
assert_equal ENV["GEM_HOME"], ps.home
- expected = util_path
+ expected = ENV["GEM_PATH"].split(File::PATH_SEPARATOR)
assert_equal expected, ps.path, "defaults to GEM_PATH"
end
@@ -25,7 +26,7 @@ class TestGemPathSupport < Gem::TestCase
assert_equal File.join(@tempdir, "foo"), ps.home
- expected = util_path + [File.join(@tempdir, 'foo')]
+ expected = ENV["GEM_PATH"].split(File::PATH_SEPARATOR) + [File.join(@tempdir, "foo")]
assert_equal expected, ps.path
end
@@ -45,8 +46,8 @@ class TestGemPathSupport < Gem::TestCase
assert_equal ENV["GEM_HOME"], ps.home
expected = [
- File.join(@tempdir, 'foo'),
- File.join(@tempdir, 'bar'),
+ File.join(@tempdir, "foo"),
+ File.join(@tempdir, "bar"),
ENV["GEM_HOME"],
]
@@ -65,8 +66,8 @@ class TestGemPathSupport < Gem::TestCase
assert_equal ENV["GEM_HOME"], ps.home
expected = [
- File.join(@tempdir, 'foo'),
- File.join(@tempdir, 'bar'),
+ File.join(@tempdir, "foo"),
+ File.join(@tempdir, "bar"),
] + Gem.default_path << ENV["GEM_HOME"]
assert_equal expected, ps.path
@@ -83,8 +84,8 @@ class TestGemPathSupport < Gem::TestCase
assert_equal ENV["GEM_HOME"], ps.home
expected = [
- File.join(@tempdir, 'foo'),
- File.join(@tempdir, 'bar'),
+ File.join(@tempdir, "foo"),
+ File.join(@tempdir, "bar"),
] + Gem.default_path << ENV["GEM_HOME"]
assert_equal expected, ps.path
@@ -97,27 +98,23 @@ class TestGemPathSupport < Gem::TestCase
assert_equal File.join(@tempdir, "foo"), ps.home
- expected = [File.join(@tempdir, 'foo'), File.join(@tempdir, 'bar')]
+ expected = [File.join(@tempdir, "foo"), File.join(@tempdir, "bar")]
assert_equal expected, ps.path
end
end
- def util_path
- ENV["GEM_PATH"].split(File::PATH_SEPARATOR)
- end
-
def test_initialize_spec
ENV["GEM_SPEC_CACHE"] = nil
ps = Gem::PathSupport.new ENV
assert_equal Gem.default_spec_cache_dir, ps.spec_cache_dir
- ENV["GEM_SPEC_CACHE"] = 'bar'
+ ENV["GEM_SPEC_CACHE"] = "bar"
ps = Gem::PathSupport.new ENV
assert_equal ENV["GEM_SPEC_CACHE"], ps.spec_cache_dir
- ENV["GEM_SPEC_CACHE"] = File.join @tempdir, 'spec_cache'
+ ENV["GEM_SPEC_CACHE"] = File.join @tempdir, "spec_cache"
ps = Gem::PathSupport.new "GEM_SPEC_CACHE" => "foo"
assert_equal "foo", ps.spec_cache_dir
@@ -130,7 +127,7 @@ class TestGemPathSupport < Gem::TestCase
begin
File.symlink(dir, symlink)
rescue NotImplementedError, SystemCallError
- pend 'symlinks not supported'
+ pend "symlinks not supported"
end
not_existing = "#{@tempdir}/does_not_exist"
path = "#{symlink}#{File::PATH_SEPARATOR}#{not_existing}"