Skip to content

Commit

Permalink
One last fix for monotonic clock on < Ruby 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wishdev committed Jul 31, 2020
1 parent 3034b9e commit 7dfca1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/timecop/time_stack_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def parse_time(*args)
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) || arg.kind_of?(Float))
@monotonic += arg * 1_000_000_000
@monotonic += arg * 1_000_000_000 if RUBY_VERSION >= '2.1.0'
time_klass.now + arg
elsif arg.nil?
time_klass.now
Expand Down

0 comments on commit 7dfca1d

Please sign in to comment.