Skip to content

Commit da7c41f

Browse files
committed
Fix mysql simple test, asset matching db conn url
1 parent e0e8b41 commit da7c41f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/db/mysql/simple_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,16 @@ def test_quoting_braces
271271
config[:database] = MYSQL_CONFIG[:database]
272272
config[:properties] = MYSQL_CONFIG[:properties].dup
273273
with_connection(config) do |connection|
274-
assert_match(/^jdbc:mysql:\/\/:\d*\//, connection.config[:url])
274+
conf = connection.instance_variable_get('@config')
275+
assert_match(/^jdbc:mysql:\/\/:\d*\//, conf[:url])
275276
end
276277

277278
ActiveRecord::Base.connection.disconnect!
278279

279280
host = [ MYSQL_CONFIG[:host] || 'localhost', '127.0.0.1' ] # fail-over
280281
with_connection(config.merge :host => host, :port => nil) do |connection|
281-
assert_match(/^jdbc:mysql:\/\/.*?127.0.0.1\//, connection.config[:url])
282+
conf = connection.instance_variable_get('@config')
283+
assert_match(/^jdbc:mysql:\/\/.*?127.0.0.1\//, conf[:url])
282284
end
283285
ensure
284286
ActiveRecord::Base.establish_connection(MYSQL_CONFIG)

0 commit comments

Comments
 (0)