From c93190bb8026b35ca58e4602f9e35493f94c7f01 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Mon, 17 Feb 2014 14:34:51 -0800 Subject: [PATCH] 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. --- test/test_connection_pool_timed_stack.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test_connection_pool_timed_stack.rb b/test/test_connection_pool_timed_stack.rb index 01f6989..33ffed3 100644 --- a/test/test_connection_pool_timed_stack.rb +++ b/test/test_connection_pool_timed_stack.rb @@ -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