Sha256: 2cc64b909596e701603b09516c5f6df196975d6e30e0edffc412adf31ca67cc9
Contents?: true
Size: 347 Bytes
Versions: 48
Compression:
Stored size: 347 Bytes
Contents
require 'epitools/ratio' describe Ratio do before :each do @a = Ratio[1,1] @b = Ratio[1,2] end it "adds" do ( @a + @b ).should == Ratio[2,3] end it "floats" do @a.to_f.should == 1.0 @b.to_f.should == 0.5 end it "percents" do @a.percent.should == "100.0%" @b.percent.should == "50.0%" end end
Version data entries
48 entries across 48 versions & 1 rubygems