Skip to content

Commit 438a003

Browse files
committed
[test] skip tests when jdbc/mysql n/a
1 parent 0ba05f5 commit 438a003

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/db/mysql/unit_test.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def initialize; end
110110
end
111111

112112
test 'configuration attempts to load MySQL driver by default' do
113-
load_jdbc_mysql
113+
skip 'jdbc/mysql not available' if load_jdbc_mysql.nil?
114114

115115
connection_handler = connection_handler_stub
116116

@@ -121,7 +121,7 @@ def initialize; end
121121
end
122122

123123
test 'configuration uses driver_name from Jdbc::MySQL' do
124-
load_jdbc_mysql
124+
skip 'jdbc/mysql not available' if load_jdbc_mysql.nil?
125125

126126
connection_handler = connection_handler_stub
127127

@@ -133,7 +133,7 @@ def initialize; end
133133
end
134134

135135
test 'configuration sets up properties according to connector/j driver (>= 8.0)' do
136-
load_jdbc_mysql
136+
skip 'jdbc/mysql not available' if load_jdbc_mysql.nil?
137137

138138
connection_handler = connection_handler_stub
139139

@@ -150,6 +150,8 @@ def initialize; end
150150

151151
def load_jdbc_mysql
152152
require 'jdbc/mysql'
153+
rescue LoadError
154+
return nil
153155
end
154156

155157
end

0 commit comments

Comments
 (0)