1 require File.dirname(__FILE__) + '/../../spec_helper'
3 describe "File.lchmod" do
4 platform_is_not :os => [:linux, :windows, :openbsd] do
6 @fname = tmp('file_chmod_test')
7 @lname = @fname + '.lnk'
8 File.delete @fname rescue nil
9 File.delete @lname rescue nil
10 File.open(@fname, 'w') { |f| f.write "rubinius" }
11 File.symlink @fname, @lname
15 File.delete @fname if File.exist? @fname
16 File.delete @lname if File.exist? @lname
19 it "changes the file mode of the link and not of the file" do
20 File.chmod(0222, @lname).should == 1
21 File.lchmod(0755, @lname).should == 1
23 File.lstat(@lname).executable?.should == true
24 File.lstat(@lname).readable?.should == true
25 File.lstat(@lname).writable?.should == true
27 File.stat(@lname).executable?.should == false
28 File.stat(@lname).readable?.should == false
29 File.stat(@lname).writable?.should == true