From 8e382e50a6f3678663dc42a5372742f8ddab5438 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Mon, 23 Nov 2009 22:03:32 +0100 Subject: [PATCH] Handle File#stat on unlinked file in a block --- spec/frozen/core/file/stat_spec.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/frozen/core/file/stat_spec.rb b/spec/frozen/core/file/stat_spec.rb index bac69a1a21..b546c4f8c1 100644 --- a/spec/frozen/core/file/stat_spec.rb +++ b/spec/frozen/core/file/stat_spec.rb @@ -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