diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-06-27 21:02:36 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-06-27 21:02:36 +0200 |
commit | d80e44deec77678fe2d72f94c17b2409b3e794d5 (patch) | |
tree | 612bf2313550e0982dda452f48492cc069e1c21a /spec/ruby/core/time/shared/now.rb | |
parent | c940397116c5aef76b1c0d05561c11d43ef596a7 (diff) |
Update to ruby/spec@8d74d49
Diffstat (limited to 'spec/ruby/core/time/shared/now.rb')
-rw-r--r-- | spec/ruby/core/time/shared/now.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/spec/ruby/core/time/shared/now.rb b/spec/ruby/core/time/shared/now.rb index 80f66a1134..d8e5ac9d50 100644 --- a/spec/ruby/core/time/shared/now.rb +++ b/spec/ruby/core/time/shared/now.rb @@ -18,16 +18,18 @@ describe :time_now, shared: true do end end - it "has at least microsecond precision" do - times = [] - 10_000.times do - times << Time.now.nsec - end + guard_not -> { platform_is :windows and ruby_version_is ""..."2.5" } do + it "has at least microsecond precision" do + times = [] + 10_000.times do + times << Time.now.nsec + end - # The clock should not be less accurate than expected (times should - # not all be a multiple of the next precision up, assuming precisions - # are multiples of ten.) - expected = 1_000 - times.select { |t| t % (expected * 10) == 0 }.size.should_not == times.size + # The clock should not be less accurate than expected (times should + # not all be a multiple of the next precision up, assuming precisions + # are multiples of ten.) + expected = 1_000 + times.select { |t| t % (expected * 10) == 0 }.size.should_not == times.size + end end end |