require 'spec_helper' describe Numeric do it 'should report formatted time accurately' do 0.to_formatted_time.should eq '00:00' (60.75).to_formatted_time.should eq '01:01' (673.2).to_formatted_time.should eq '11:13' end it 'should periods accurately' do 3600.to_period.should eq '1h' 7260.to_period.should eq '2h 1m' (86400 + 10).to_period.should eq '1d 10s' end end