From 0a6b61a5f534c07406f1ec2de11b4a53ce81151d Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 29 Oct 2012 09:02:48 +0100 Subject: descriptive error message when AR adapter was not found. Closes #7313. --- .../test/cases/connection_specification/resolver_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/connection_specification/resolver_test.rb b/activerecord/test/cases/connection_specification/resolver_test.rb index f0a2cdca1a..fb21ab4f50 100644 --- a/activerecord/test/cases/connection_specification/resolver_test.rb +++ b/activerecord/test/cases/connection_specification/resolver_test.rb @@ -70,6 +70,15 @@ module ActiveRecord spec = resolve "abstract://foo:#{encoded_password}@localhost/bar" assert_equal password, spec[:password] end + + def test_descriptive_error_message_when_adapter_is_missing + error = assert_raise(LoadError) do + resolve(adapter: 'non-existing') + end + + assert_match "Could not load 'active_record/connection_adapters/non-existing_adapter'", error.message + end + end end end -- cgit v1.2.3