summaryrefslogtreecommitdiff
path: root/test/ruby/test_sleep.rb
blob: adc487621657947681115407caba98a24545d7b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'test/unit'

class TestSleep < Test::Unit::TestCase
  def test_sleep_5sec
    GC.disable
    start = Time.now
    sleep 5
    slept = Time.now-start
    assert_in_delta(5.0, slept, 0.1, "[ruby-core:18015]: longer than expected")
  ensure
    GC.enable
  end
end