diff --git a/Changes.md b/Changes.md index bd15297..bd4cf0b 100644 --- a/Changes.md +++ b/Changes.md @@ -6,7 +6,7 @@ HEAD - Use monotonic clock present in all modern Rubies [Tero Tasanen, #109] - Remove code hacks necessary for JRuby 1.7 -- Expose `pool` from ConnectionPool::Wrapper [Thomas Lecavelier, #113] +- Expose wrapped pool from ConnectionPool::Wrapper [Thomas Lecavelier, #113] 2.2.2 ------ diff --git a/lib/connection_pool.rb b/lib/connection_pool.rb index 645cebc..037c076 100644 --- a/lib/connection_pool.rb +++ b/lib/connection_pool.rb @@ -109,13 +109,13 @@ def available private class Wrapper < ::BasicObject - METHODS = [:with, :pool_shutdown, :pool] + METHODS = [:with, :pool_shutdown, :wrapped_pool] def initialize(options = {}, &block) @pool = options.fetch(:pool) { ::ConnectionPool.new(options, &block) } end - def pool + def wrapped_pool @pool end diff --git a/test/test_connection_pool.rb b/test/test_connection_pool.rb index a144778..4aa0c0a 100644 --- a/test/test_connection_pool.rb +++ b/test/test_connection_pool.rb @@ -474,9 +474,9 @@ def test_shutdown_is_executed_for_all_connections_in_wrapped_pool assert_equal [["shutdown"]] * 3, recorders.map { |r| r.calls } end - def test_wrapper_pool + def test_wrapper_wrapped_pool wrapper = ConnectionPool::Wrapper.new { NetworkConnection.new } - assert_equal ConnectionPool, wrapper.pool.class + assert_equal ConnectionPool, wrapper.wrapped_pool.class end def test_wrapper_method_missing