From 4846eeee0f422c885e13325364f8e860a0c1595e Mon Sep 17 00:00:00 2001
From: Kir Shatrov <shatrov@me.com>
Date: Mon, 27 Feb 2017 08:22:56 -0600
Subject: Handle non-existing $ARCONN

---
 activerecord/test/support/connection.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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
-- 
cgit v1.2.3