Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise TypeError instead of infinite loop in resolve_connection #36848

Merged
merged 1 commit into from Aug 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -221,7 +221,7 @@ def resolve_connection(config_or_env, pool_name = nil)
when Hash
resolve_hash_connection config_or_env
else
resolve_connection config_or_env
raise TypeError, "Invalid type for configuration. Expected Symbol, String, or Hash. Got #{config_or_env.inspect}"
end
end

Expand Down
Expand Up @@ -135,6 +135,12 @@ def test_spec_name_with_inline_config
spec = spec("adapter" => "sqlite3")
assert_equal "primary", spec.name, "should default to primary id"
end

def test_spec_with_invalid_type
assert_raises TypeError do
spec(Object.new)
end
end
end
end
end
Expand Down