1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use getent and cut on Solaris to get home directory

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2018-12-04 00:40:49 +00:00
parent 7ea31367bb
commit 5e8e1fcf87

View file

@ -14,9 +14,15 @@ describe "Dir.home" do
Dir.home.should == home_directory Dir.home.should == home_directory
end end
platform_is_not :windows do platform_is :solaris do
it "returns the named user's home directory, from the user database, as a string if called with an argument" do it "returns the named user's home directory, from the user database, as a string if called with an argument" do
Dir.home(ENV['USER']).should == `/bin/echo ~#{ENV['USER']}`.chomp Dir.home(ENV['USER']).should == `getent passwd ~#{ENV['USER']}|cut -d: -f6`.chomp
end
end
platform_is_not :windows, :solaris do
it "returns the named user's home directory, from the user database, as a string if called with an argument" do
Dir.home(ENV['USER']).should == `echo ~#{ENV['USER']}`.chomp
end end
end end