1
0
Fork 0
mirror of https://github.com/mperham/connection_pool synced 2023-03-27 23:22:21 -04:00

Test TimedStack#pop with a precreated item

This test was missed during my initial pass.  If the @que assignment
in #initialize is changed no tests fail so this test is necessary.
This commit is contained in:
Eric Hodel 2014-02-17 14:34:51 -08:00
parent 7ab284b6ec
commit c93190bb80

View file

@ -40,6 +40,15 @@ class TestConnectionPoolTimedStack < Minitest::Test
assert_equal 'Waited 0 sec', e.message
end
def test_pop_full
stack = ConnectionPool::TimedStack.new(1) { Object.new }
popped = stack.pop
refute_nil popped
assert_empty stack
end
def test_pop_wait
thread = Thread.start do
@stack.pop