diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-04 00:40:49 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-04 00:40:49 +0000 |
commit | 5e8e1fcf87601d2f91a5d58b2a92c7b6089adddf (patch) | |
tree | 06a8720b9a1e56aab7bf8c7cb605e46c7d92cedf /spec/ruby | |
parent | 7ea31367bbbdf0c674a96730a26b477def8ca4a9 (diff) |
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
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/dir/home_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/ruby/core/dir/home_spec.rb b/spec/ruby/core/dir/home_spec.rb index 8935eb4f4b..e08722df88 100644 --- a/spec/ruby/core/dir/home_spec.rb +++ b/spec/ruby/core/dir/home_spec.rb @@ -14,9 +14,15 @@ describe "Dir.home" do Dir.home.should == home_directory 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 - 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 |