aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_path_support.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-01 12:45:11 +0300
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-01 13:50:41 +0300
commit56660de3c6df7a4ff8667ef4047d30d0de169935 (patch)
treedd1e526075687b4b24e089cee50eabc21a6143cc /test/rubygems/test_gem_path_support.rb
parent560cd5b1f04f30542a294b3d77527d3b12f7cc15 (diff)
downloadruby-56660de3c6df7a4ff8667ef4047d30d0de169935.tar.gz
Merge rubygems master from upstream.
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
Diffstat (limited to 'test/rubygems/test_gem_path_support.rb')
-rw-r--r--test/rubygems/test_gem_path_support.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/test/rubygems/test_gem_path_support.rb b/test/rubygems/test_gem_path_support.rb
index 1f9cfe2c57..8715bb62dc 100644
--- a/test/rubygems/test_gem_path_support.rb
+++ b/test/rubygems/test_gem_path_support.rb
@@ -40,17 +40,19 @@ class TestGemPathSupport < Gem::TestCase
end
def test_initialize_path
- ps = Gem::PathSupport.new ENV.to_hash.merge("GEM_PATH" => %W[#{@tempdir}/foo #{@tempdir}/bar].join(Gem.path_separator))
+ Gem.stub(:path_separator, File::PATH_SEPARATOR) do
+ ps = Gem::PathSupport.new ENV.to_hash.merge("GEM_PATH" => %W[#{@tempdir}/foo #{@tempdir}/bar].join(Gem.path_separator))
- assert_equal ENV["GEM_HOME"], ps.home
+ assert_equal ENV["GEM_HOME"], ps.home
- expected = [
- File.join(@tempdir, 'foo'),
- File.join(@tempdir, 'bar'),
- ENV["GEM_HOME"],
- ]
+ expected = [
+ File.join(@tempdir, 'foo'),
+ File.join(@tempdir, 'bar'),
+ ENV["GEM_HOME"],
+ ]
- assert_equal expected, ps.path
+ assert_equal expected, ps.path
+ end
end
def test_initialize_regexp_path_separator
@@ -90,13 +92,15 @@ class TestGemPathSupport < Gem::TestCase
end
def test_initialize_home_path
- ps = Gem::PathSupport.new("GEM_HOME" => "#{@tempdir}/foo",
- "GEM_PATH" => %W[#{@tempdir}/foo #{@tempdir}/bar].join(Gem.path_separator))
+ Gem.stub(:path_separator, File::PATH_SEPARATOR) do
+ ps = Gem::PathSupport.new("GEM_HOME" => "#{@tempdir}/foo",
+ "GEM_PATH" => %W[#{@tempdir}/foo #{@tempdir}/bar].join(Gem.path_separator))
- assert_equal File.join(@tempdir, "foo"), ps.home
+ assert_equal File.join(@tempdir, "foo"), ps.home
- expected = [File.join(@tempdir, 'foo'), File.join(@tempdir, 'bar')]
- assert_equal expected, ps.path
+ expected = [File.join(@tempdir, 'foo'), File.join(@tempdir, 'bar')]
+ assert_equal expected, ps.path
+ end
end
def util_path