1 require File.dirname(__FILE__) + '/../../spec_helper'
3 describe "File.readlink" do
8 File.delete(@file3) if File.exists?(@file3)
10 File.open(@file1, 'w+') { } #
11 File.symlink(@file1, @file3)
15 File.delete(@file1) if File.exists?(@file1)
16 File.delete(@file3) if File.symlink?(@file3)
19 it "return the name of the file referenced by the given link" do
20 File.readlink(@file3).should == @file1
23 it "raises an Errno::ENOENT if called with an invalid argument" do
24 lambda { File.readlink("/this/surely/doesnt/exist") }.should raise_error(Errno::ENOENT)