From 5b93321064e83ea180492469071189372e8289e8 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 27 Apr 2019 19:23:45 +0200 Subject: Update to ruby/spec@14e6148 --- spec/ruby/core/file/expand_path_spec.rb | 17 ++++++++++------- 1 file 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 -- cgit v1.2.3