Sha256: 0e55621b5f9a5c400b0ce9b812f1bd1d7f268988071c42d2f2ac2929b25d7cb1

Contents?: true

Size: 858 Bytes

Versions: 83

Compression:

Stored size: 858 Bytes

Contents

describe :file_size, :shared => true do
  before :each do
    @empty = "i_am_empty"
    File.delete @empty if File.exist? @empty
    File.open(@empty,'w') { }

    @exists = tmp('i_exist')
    File.open(@exists,'w') { |f| f.write 'rubinius' }
  end

  after :each do
    File.delete @empty if File.exist? @empty
    File.delete @exists if File.exist? @exists
  end

  it "returns nil if the file has zero size" do
    @object.send(@method, @empty).should == nil
  end

  it "returns the size of the file if it exists and is not empty" do
    @object.send(@method, @exists).should == 8
  end
end

describe :file_size_missing, :shared => true do
  before :each do
    @missing = "i_dont_exist"
    File.delete @missing if File.exists? @missing
  end

  it "returns nil if file_name doesn't exist" do
    @object.send(@method, @missing).should == nil
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

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