lib/timecop/time_stack_item.rb in timecop-0.8.0 vs lib/timecop/time_stack_item.rb in timecop-0.8.1
- old
+ new
@@ -99,10 +99,10 @@
arg
elsif Object.const_defined?(:DateTime) && arg.is_a?(DateTime)
time_klass.at(arg.to_time.to_f).getlocal
elsif Object.const_defined?(:Date) && arg.is_a?(Date)
time_klass.local(arg.year, arg.month, arg.day, 0, 0, 0)
- elsif args.empty? && arg.kind_of?(Integer)
+ elsif args.empty? && (arg.kind_of?(Integer) || arg.kind_of?(Float))
Time.now + arg
elsif arg.nil?
Time.now
else
if arg.is_a?(String) && Time.respond_to?(:parse)