Sha256: d6aa5d0569c09eaa52b1051bae392ff0a6ae87990dfab5b3bd7eef6367eb07d8

Contents?: true

Size: 609 Bytes

Versions: 2

Compression:

Stored size: 609 Bytes

Contents

#          Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the MIT license.

require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)

describe "Numeric#filesize_format" do
  it 'it should convert filesizes to human readable format' do
    1.filesize_format.should == '1'
    1024.filesize_format.should == '1.0K'
    (1 << 20).filesize_format.should == '1.0M'
    (1 << 20).filesize_format.should == '1.0M'
    (1 << 30).filesize_format.should == '1.0G'
    (1 << 40).filesize_format.should == '1.0T'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-2012.04.14 spec/snippets/numeric/filesize_format.rb
ramaze-2012.03.07 spec/snippets/numeric/filesize_format.rb