Sha256: 64698bd1b5a1f22f6c763973b242bb93e8deba04dfb6e3d64b9284c9f95d3513

Contents?: true

Size: 610 Bytes

Versions: 14

Compression:

Stored size: 610 Bytes

Contents

#          Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby 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

14 entries across 14 versions & 3 rubygems

Version Path
Pistos-ramaze-2009.06.12 spec/snippets/numeric/filesize_format.rb
manveru-ramaze-2009.07 spec/snippets/numeric/filesize_format.rb
ramaze-2011.12.28 spec/snippets/numeric/filesize_format.rb
ramaze-2011.10.23 spec/snippets/numeric/filesize_format.rb
ramaze-2011.07.25 spec/snippets/numeric/filesize_format.rb
ramaze-2011.01.30 spec/snippets/numeric/filesize_format.rb
ramaze-2011.01 spec/snippets/numeric/filesize_format.rb
ramaze-2010.06.18 spec/snippets/numeric/filesize_format.rb
ramaze-2010.04.04 spec/snippets/numeric/filesize_format.rb
ramaze-2010.04 spec/snippets/numeric/filesize_format.rb
ramaze-2010.03 spec/snippets/numeric/filesize_format.rb
ramaze-2010.01 spec/snippets/numeric/filesize_format.rb
ramaze-2009.10 spec/snippets/numeric/filesize_format.rb
ramaze-2009.07 spec/snippets/numeric/filesize_format.rb