Skip to content

Commit a746afe

Browse files
committed
Tests: allow oci connection via eazyconnect url
1 parent 944f5bf commit a746afe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spec/spec_helper.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,16 @@
3535
# specify which database version is used (will be verified in one test)
3636
DATABASE_VERSION = ENV['DATABASE_VERSION'] || '10.2.0.4'
3737

38+
def get_eazy_connect_url(svc_separator = "")
39+
"#{DATABASE_HOST}:#{DATABASE_PORT}#{svc_separator}#{DATABASE_SERVICE_NAME}"
40+
end
41+
3842
def get_connection(user_number = 0)
3943
database_user, database_password = DATABASE_USERS_AND_PASSWORDS[user_number]
4044
unless defined?(JRUBY_VERSION)
45+
url = (ENV['DATABASE_USE_TNS'] == 'NO') ? get_eazy_connect_url("/") : DATABASE_NAME
4146
try_to_connect(OCIError) do
42-
OCI8.new(database_user, database_password, DATABASE_NAME)
47+
OCI8.new(database_user, database_password, url)
4348
end
4449
else
4550
try_to_connect(NativeException) do

0 commit comments

Comments
 (0)