Sha256: 99d78af2500eabd1faf6f867696c450941b7442a8f0f397349abdb3b4c632090

Contents?: true

Size: 958 Bytes

Versions: 83

Compression:

Stored size: 958 Bytes

Contents

describe :file_writable_real, :shared => true do
  before :each do
    @file = tmp('i_exist')
  end

  after :each do
    File.delete(@file) if File.exist?(@file)
  end

  it "returns true if named file is writable by the real user id of the process, otherwise false" do
    File.open(@file,'w') { @object.send(@method, @file).should == true }
  end

  it "raises an ArgumentError if not passed one argument" do
    lambda { File.writable_real?        }.should raise_error(ArgumentError)
  end

  it "raises a TypeError if not passed a String type" do
    lambda { @object.send(@method, 1)     }.should raise_error(TypeError)
    lambda { @object.send(@method, nil)   }.should raise_error(TypeError)
    lambda { @object.send(@method, false) }.should raise_error(TypeError)
  end
end

describe :file_writable_real_missing, :shared => true do
  it "returns false if the file does not exist" do
    @object.send(@method, 'fake_file').should == false
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
rhodes-2.2.6 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.6.beta.1 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.5 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.5.beta.3 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.5.beta.2 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.5.beta.1 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.4.beta.1 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.3 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.3.beta.1 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.2 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.2.beta.1 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.1 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.1.beta.2 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.1.beta.1 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.0 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.0.beta.3 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.0.beta.2 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.2.0.beta.1 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.1.0 spec/framework_spec/app/spec/shared/file/writable_real.rb
rhodes-2.0.3 spec/framework_spec/app/spec/shared/file/writable_real.rb