Skip to content

Commit

Permalink
Handle File#stat on unlinked file in a block
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Nov 23, 2009
1 parent 73a353c commit 8e382e5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions spec/frozen/core/file/stat_spec.rb
Expand Up @@ -20,20 +20,20 @@
end

it "should be able to call stat on an unlinked file" do
f = File.open(@file)

File.unlink(@link)
File.unlink(@file)
st = f.stat

st.file?.should == true
st.zero?.should == false
st.size.should == 8
st.size?.should == 8
st.blksize.should > 0
st.atime.class.should == Time
st.ctime.class.should == Time
st.mtime.class.should == Time
File.open(@file) do |f|
File.unlink(@link)
File.unlink(@file)
st = f.stat

st.file?.should == true
st.zero?.should == false
st.size.should == 8
st.size?.should == 8
st.blksize.should > 0
st.atime.class.should == Time
st.ctime.class.should == Time
st.mtime.class.should == Time
end
end

platform_is_not :windows do
Expand Down

0 comments on commit 8e382e5

Please sign in to comment.