Skip to content

Commit

Permalink
Use should < to get better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Nov 7, 2024
1 parent 2bfd21f commit c43c654
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/kernel/sleep_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ def o.divmod(*); [0, 0.001]; end
end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)

actual_duration = end_time - start_time
puts "start: #{start_time}, end: #{end_time}, actual: #{actual_duration}"
(actual_duration > 0.01).should == true # 100 * 0.0001 => 0.01
(actual_duration < 0.03).should == true
actual_duration.should > 0.01 # 100 * 0.0001 => 0.01
actual_duration.should < 0.03
end

ruby_version_is ""..."3.3" do
Expand Down

0 comments on commit c43c654

Please sign in to comment.