Sha256: 4bcc0383dd91e943d77320248d2ca52c0f80edff93153d27ee887d2cadc4c671

Contents?: true

Size: 1.07 KB

Versions: 52

Compression:

Stored size: 1.07 KB

Contents

require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper'

describe "File.lchmod" do
  platform_is_not :os => [:linux, :windows, :openbsd] do
    before :each do
      @fname = tmp('file_chmod_test')
      @lname = @fname + '.lnk'
      File.delete @fname rescue nil
      File.delete @lname rescue nil
      File.open(@fname, 'w') { |f| f.write "rubinius" }
      File.symlink @fname, @lname
    end
    
    after :each do
      # the link should be removed first
      File.delete @lname if File.exist? @lname
      File.delete @fname if File.exist? @fname
    end
    
    it "changes the file mode of the link and not of the file" do
      File.chmod(0222, @lname).should  == 1
      File.lchmod(0755, @lname).should == 1
      
      File.lstat(@lname).executable?.should == true
      File.lstat(@lname).readable?.should   == true
      File.lstat(@lname).writable?.should   == true
  
      File.stat(@lname).executable?.should == false
      File.stat(@lname).readable?.should   == false
      File.stat(@lname).writable?.should   == true
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
rhodes-2.3.2 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.3.2.beta.2 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.3.2.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.3.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.3.1.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.3.0 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.3.0.beta.3 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.3.0.beta.2 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.3.0.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.6 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.6.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.5 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.5.beta.3 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.5.beta.2 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.5.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.4.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.3 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.3.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.2 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-2.2.2.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb