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:
parent
7ab284b6ec
commit
c93190bb80
1 changed files with 9 additions and 0 deletions
|
@ -40,6 +40,15 @@ class TestConnectionPoolTimedStack < Minitest::Test
|
||||||
assert_equal 'Waited 0 sec', e.message
|
assert_equal 'Waited 0 sec', e.message
|
||||||
end
|
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
|
def test_pop_wait
|
||||||
thread = Thread.start do
|
thread = Thread.start do
|
||||||
@stack.pop
|
@stack.pop
|
||||||
|
|
Loading…
Reference in a new issue