Sha256: e0e918fe2518b5b316d7bc54035a1e3f48c44680274d2b71623bbde08924dc4f

Contents?: true

Size: 420 Bytes

Versions: 40

Compression:

Stored size: 420 Bytes

Contents

require 'lib/ramaze/spec/helper/snippets'

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

40 entries across 40 versions & 6 rubygems

Version Path
Pistos-ramaze-2008.09 spec/snippets/numeric/filesize_format.rb
Pistos-ramaze-2008.12 spec/snippets/numeric/filesize_format.rb
Pistos-ramaze-2009.01 spec/snippets/numeric/filesize_format.rb
Pistos-ramaze-2009.02 spec/snippets/numeric/filesize_format.rb
Pistos-ramaze-2009.04.08 spec/snippets/numeric/filesize_format.rb
clivecrous-ramaze-0.3.9.5 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2008.07 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2008.08 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2008.09 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2008.10 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2008.12 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.01 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.04.01 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.04.08 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.04.18 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.04.22 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.04 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.05.08 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.05 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.06.04 spec/snippets/numeric/filesize_format.rb