Sha256: 3574fc6a4b74fe23b29f71f10a37fc3a67a99436be3cc5a0c70fb3fc12bf07ef

Contents?: true

Size: 1.08 KB

Versions: 31

Compression:

Stored size: 1.08 KB

Contents

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

describe "File.lchmod" do
  platform_is_not :os => [:linux, :windows, :openbsd, :android] 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

31 entries across 31 versions & 1 rubygems

Version Path
rhodes-3.1.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.1.1.beta spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.1.0 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.1.0.beta.5 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.1.0.beta.4 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.1.0.beta.3 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.1.0.beta.2 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.1.0.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.2 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.2.beta.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.1 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.1.beta.8 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.1.beta.7 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.1.beta.6 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.1.beta.5 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.1.beta.4 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.1.beta.3 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.1.beta.2 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.0 spec/framework_spec/app/spec/core/file/lchmod_spec.rb
rhodes-3.0.0.beta.7 spec/framework_spec/app/spec/core/file/lchmod_spec.rb