aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-02-28 01:13:50 +1030
committerGitHub <noreply@github.com>2017-02-28 01:13:50 +1030
commit0bd325e5efc907ee4eade0c449c1635027ec5e6a (patch)
treed780a7d33f5d2b4d7da397908112872d151d359d /activerecord
parentcbbbbcc3054bdf3e08dd01f24ba55a0b57eeed46 (diff)
parent4846eeee0f422c885e13325364f8e860a0c1595e (diff)
downloadrails-0bd325e5efc907ee4eade0c449c1635027ec5e6a.tar.gz
rails-0bd325e5efc907ee4eade0c449c1635027ec5e6a.tar.bz2
rails-0bd325e5efc907ee4eade0c449c1635027ec5e6a.zip
Merge pull request #28199 from kirs/ar-test-connection
Handle non-existing $ARCONN
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/support/connection.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/test/support/connection.rb b/activerecord/test/support/connection.rb
index bc5af36a28..1a609e13c3 100644
--- a/activerecord/test/support/connection.rb
+++ b/activerecord/test/support/connection.rb
@@ -10,7 +10,10 @@ module ARTest
end
def self.connection_config
- config["connections"][connection_name]
+ config.fetch("connections").fetch(connection_name) do
+ puts "Connection #{connection_name.inspect} not found. Available connections: #{config['connections'].keys.join(', ')}"
+ exit 1
+ end
end
def self.connect