Updated RubySpec source to d6754b35 except language/def_spec.rb.
[rbx.git] / spec / frozen / 1.8 / core / file / readlink_spec.rb
blob7ff713d5ec1354d1ebf80869a71fcbb1c2a33480
1 require File.dirname(__FILE__) + '/../../spec_helper'
3 describe "File.readlink" do
5   before :each do
6     @file1 = 'test.txt'
7     @file3 = 'test.lnk'
8     File.delete(@file3) if File.exists?(@file3)
10     File.open(@file1, 'w+') { } #
11     File.symlink(@file1, @file3)
12   end
14   after :each do
15     File.delete(@file1) if File.exists?(@file1)
16     File.delete(@file3) if File.symlink?(@file3)
17   end
19   it "return the name of the file referenced by the given link" do
20     File.readlink(@file3).should == @file1
21   end
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)
25   end
26 end