summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-04-27 19:23:45 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-04-27 19:23:45 +0200
commit5b93321064e83ea180492469071189372e8289e8 (patch)
tree2ded83906c0bdf6eb6b5a9a6be541ae15235039c
parent14f004d3962f799ae2caca7d6a82f508e51270bc (diff)
Update to ruby/spec@14e6148
-rw-r--r--spec/ruby/core/file/expand_path_spec.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/spec/ruby/core/file/expand_path_spec.rb b/spec/ruby/core/file/expand_path_spec.rb
index b03bb3a2ca..c2899fe1ac 100644
--- a/spec/ruby/core/file/expand_path_spec.rb
+++ b/spec/ruby/core/file/expand_path_spec.rb
@@ -2,6 +2,7 @@
require_relative '../../spec_helper'
require_relative 'fixtures/common'
+require 'etc'
describe "File.expand_path" do
before :each do
@@ -222,14 +223,16 @@ platform_is_not :windows do
ENV["HOME"] = @home
end
- it "uses the user database when passed '~' if HOME is nil" do
- ENV.delete "HOME"
- File.directory?(File.expand_path("~")).should == true
- end
+ guard -> { Etc.getlogin } do
+ it "uses the user database when passed '~' if HOME is nil" do
+ ENV.delete "HOME"
+ File.directory?(File.expand_path("~")).should == true
+ end
- it "uses the user database when passed '~/' if HOME is nil" do
- ENV.delete "HOME"
- File.directory?(File.expand_path("~/")).should == true
+ it "uses the user database when passed '~/' if HOME is nil" do
+ ENV.delete "HOME"
+ File.directory?(File.expand_path("~/")).should == true
+ end
end
it "raises an ArgumentError when passed '~' if HOME == ''" do