Skip to content

Commit

Permalink
mperham#113 PR comment: rename #pool to #wrapped_pool
Browse files Browse the repository at this point in the history
  • Loading branch information
ook committed Mar 1, 2019
1 parent 1969c61 commit 03c3f56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Changes.md
Expand Up @@ -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
------
Expand Down
4 changes: 2 additions & 2 deletions lib/connection_pool.rb
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/test_connection_pool.rb
Expand Up @@ -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
Expand Down

0 comments on commit 03c3f56

Please sign in to comment.