Skip to content

Commit

Permalink
Add spec for Dir.home(nil)
Browse files Browse the repository at this point in the history
See #7735
  • Loading branch information
headius committed Mar 29, 2023
1 parent 1e8d725 commit 30c48ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/ruby/core/dir/home_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,10 @@
it "raises an ArgumentError if the named user doesn't exist" do
-> { Dir.home('geuw2n288dh2k') }.should raise_error(ArgumentError)
end

describe "when called with a nil user name" do
it "returns the current user's home directory, reading $HOME first" do
Dir.home(nil).should == "/rubyspec_home"
end
end
end

0 comments on commit 30c48ac

Please sign in to comment.