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-2.0.2 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.rc2 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.rc1 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta11 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta10 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta9 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta8 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta7 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta6 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta4 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta3 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-1.5.5 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta2 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-2.0.0.beta1 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-1.5.4 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-1.5.3 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-1.5.2 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-1.5.1 spec/framework_spec/app/spec/shared/file/size.rb
rhodes-1.5.0 spec/framework_spec/app/spec/shared/file/size.rb