spec/rtime_spec.rb in rufus-scheduler-2.0.15 vs spec/rtime_spec.rb in rufus-scheduler-2.0.16
- old
+ new
@@ -6,11 +6,11 @@
#
require 'spec_base'
-describe 'rufus/otime' do
+describe 'rufus/rtime' do
def pts(s)
Rufus.parse_time_string(s)
end
@@ -22,22 +22,25 @@
Rufus.to_duration_hash(f, opts)
end
it 'parses duration strings' do
+ pts('').should == 0.0
pts('5.0').should == 5.0
pts('0.5').should == 0.5
pts('.5').should == 0.5
pts('5.').should == 5.0
pts('500').should == 0.5
pts('1000').should == 1.0
pts('1').should == 0.001
pts('1s').should == 1.0
+ pts('2.5s').should == 2.5
pts('1h').should == 3600.0
pts('1h10s').should == 3610.0
pts('1w2d').should == 777600.0
pts('1d1w1d').should == 777600.0
+ pts('1.0d1.0w1.0d').should == 777600.0
end
it 'generates duration strings' do
tts(0).should == '0s'
@@ -59,10 +62,10 @@
tdh(61.127).should == { :m => 1, :s => 1, :ms => 127 }
tdh(61.127, :drop_seconds => true).should == { :m => 1 }
end
end
-describe 'rufus/otime#at_to_f' do
+describe 'rufus/rtime#at_to_f' do
def atf(o)
Rufus.at_to_f(o)
end