diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/rubyspec/core/file/realdirpath_spec.rb | 8 | ||||
-rw-r--r-- | spec/rubyspec/core/file/realpath_spec.rb | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/spec/rubyspec/core/file/realdirpath_spec.rb b/spec/rubyspec/core/file/realdirpath_spec.rb index 3d50b8813c..06900ad461 100644 --- a/spec/rubyspec/core/file/realdirpath_spec.rb +++ b/spec/rubyspec/core/file/realdirpath_spec.rb @@ -88,9 +88,13 @@ platform_is :windows do @file = tmp("realdirpath") end + after :each do + rm_r @file + end + it "returns the same path" do - file = __FILE__ - File.realdirpath(file).should == file + touch @file + File.realdirpath(@file).should == @file end it "returns the same path even if the last component does not exist" do diff --git a/spec/rubyspec/core/file/realpath_spec.rb b/spec/rubyspec/core/file/realpath_spec.rb index e6ddfdad7c..49aed7b88c 100644 --- a/spec/rubyspec/core/file/realpath_spec.rb +++ b/spec/rubyspec/core/file/realpath_spec.rb @@ -72,9 +72,17 @@ end platform_is :windows do describe "File.realpath" do + before :each do + @file = tmp("realpath") + touch @file + end + + after :each do + rm_r @file + end + it "returns the same path" do - file = __FILE__ - File.realpath(file).should == file + File.realpath(@file).should == @file end end end |