Sha256: fd78c2510f1fe89e51786ab457ee1053b5de73b0dabc20bfe157139b77c6d87e
Contents?: true
Size: 693 Bytes
Versions: 85
Compression:
Stored size: 693 Bytes
Contents
require "spec_helper" require "cf/cli/app/base" describe CF::App::Base do describe "#human_size" do let(:base) { CF::App::Base.new } it { base.human_size(1_023).should == "1023.0B" } it { base.human_size(1_024).should == "1.0K" } it { base.human_size(1_024 * 1_024).should == "1.0M" } it { base.human_size(1_024 * 1_024 * 1.5).should == "1.5M" } it { base.human_size(1_024 * 1_024 * 1_024).should == "1.0G" } it { base.human_size(1_024 * 1_024 * 1_024 * 1.5).should == "1.5G" } it { base.human_size(1_024 * 1_024 * 1_024 * 1.234, 3).should == "1.234G" } it { base.human_size(31395840).should == "29.9M" } # tests against floating point errors end end
Version data entries
85 entries across 85 versions & 2 rubygems