Skip to content

Commit

Permalink
Added explicit umask to File permission spec so it won't fail on
Browse files Browse the repository at this point in the history
non-standard umasks.
  • Loading branch information
bennyandresen authored and Eero Saynatkari committed Jan 8, 2008
1 parent 6df303e commit cda3d86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions spec/ruby/1.8/core/file/new_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
File.exists?(@file).should == true
end

it "return a new File with modus num and premissions " do
it "return a new File with modus num and permissions" do
File.delete(@file)
File.umask(0011)
@fh = File.new(@file, @flags, 0755)
@fh.class.should == File
File.stat(@file).mode.to_s(8).should == "100755"
File.stat(@file).mode.to_s(8).should == "100744"
File.exists?(@file).should == true
end

Expand Down
3 changes: 2 additions & 1 deletion spec/ruby/1.8/core/file/open_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
# For this test we delete the file first to reset the perms
it "open the file when call with mode, num and permissions" do
File.delete(@file)
File.umask(0011)
@fh = File.open(@file, @flags, 0755)
File.stat(@file).mode.to_s(8).should == "100755"
File.stat(@file).mode.to_s(8).should == "100744"
@fh.class.should == File
File.exists?(@file).should == true
end
Expand Down

0 comments on commit cda3d86

Please sign in to comment.