summaryrefslogtreecommitdiff
path: root/spec/ruby/core/time/shared/now.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/time/shared/now.rb')
-rw-r--r--spec/ruby/core/time/shared/now.rb22
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