From a746afeeef5db3da371857b7a637b531a98ddcd2 Mon Sep 17 00:00:00 2001 From: Yavor Nikolov Date: Sun, 5 Oct 2014 15:19:06 +0300 Subject: [PATCH] Tests: allow oci connection via eazyconnect url --- spec/spec_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8413781c..067958d7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -35,11 +35,16 @@ # specify which database version is used (will be verified in one test) DATABASE_VERSION = ENV['DATABASE_VERSION'] || '10.2.0.4' +def get_eazy_connect_url(svc_separator = "") + "#{DATABASE_HOST}:#{DATABASE_PORT}#{svc_separator}#{DATABASE_SERVICE_NAME}" +end + def get_connection(user_number = 0) database_user, database_password = DATABASE_USERS_AND_PASSWORDS[user_number] unless defined?(JRUBY_VERSION) + url = (ENV['DATABASE_USE_TNS'] == 'NO') ? get_eazy_connect_url("/") : DATABASE_NAME try_to_connect(OCIError) do - OCI8.new(database_user, database_password, DATABASE_NAME) + OCI8.new(database_user, database_password, url) end else try_to_connect(NativeException) do