@@ -63,21 +63,23 @@ defmodule DBConnectionTest do
6363 end
6464
6565 describe "connection_module/1" do
66- test "returns the connection module when given a pool pid" do
67- { :ok , pool } = P . start_link ( [ ] )
66+ setup do
67+ { :ok , agent } = A . start_link ( [ { :ok , :state } , { :idle , :state } , { :idle , :state } ] )
68+ [ agent: agent ]
69+ end
70+
71+ test "returns the connection module when given a pool pid" , % { agent: agent } do
72+ { :ok , pool } = P . start_link ( agent: agent )
6873 assert { :ok , TestConnection } = DBConnection . connection_module ( pool )
6974 end
7075
71- test "returns the connection module when given a pool name" , % { test: name } do
72- { :ok , _pool } = P . start_link ( name: name )
76+ test "returns the connection module when given a pool name" , % { test: name , agent: agent } do
77+ { :ok , _pool } = P . start_link ( name: name , agent: agent )
7378 assert { :ok , TestConnection } = DBConnection . connection_module ( name )
7479 end
7580
76- test "returns the connection module when given a locked connection reference" do
77- { :ok , agent } = A . start_link ( [ { :ok , :state } , { :idle , :state } , { :idle , :state } ] )
78-
79- opts = [ agent: agent ]
80- { :ok , pool } = P . start_link ( opts )
81+ test "returns the connection module when given a locked connection reference" , % { agent: agent } do
82+ { :ok , pool } = P . start_link ( agent: agent )
8183
8284 P . run ( pool , fn conn ->
8385 assert { :ok , TestConnection } = DBConnection . connection_module ( conn )
0 commit comments