mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@8d74d49
This commit is contained in:
parent
c940397116
commit
d80e44deec
157 changed files with 581 additions and 543 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue