1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
# -*- coding: utf-8 -*-
require 'test/unit'
require File.expand_path(File.join('..', 'timelimitedqueue'))
class TC_TimeLimitedQueue < Test::Unit::TestCase
def setup
Thread.abort_on_exception = true
end
# def teardown
# end
def test_output
tlq = TimeLimitedQueue.new(10, 1){ |v| p v }
100.times{ |n|
tlq.push(n) }
assert_equal(tlq.thread.group, TimeLimitedQueue::TLQGroup)
# sleep(1)
end
end
# >> Loaded suite -
# >> Started
# >> .
# >> Finished in 0.001979 seconds.
# >>
# >> 1 tests, 1 assertions, 0 failures, 0 errors
|