Skip to content

Commit 9e56c07

Browse files
committed
Check for SSL state to give a more specific pending state message
1 parent 6b9c23d commit 9e56c07

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spec/mysql2/client_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ def connect *args
7878
end
7979

8080
it "should be able to connect via SSL options" do
81-
pending("DON'T WORRY, THIS TEST PASSES :) - but is machine-specific. You need to have MySQL running with SSL configured and enabled. Then update the paths in this test to your needs and remove the pending state.")
81+
ssl = @client.query "SHOW VARIABLES LIKE 'have_%ssl'"
82+
ssl_enabled = ssl.any? {|x| x['Value'] == 'ENABLED'}
83+
pending("DON'T WORRY, THIS TEST PASSES - but SSL is not enabled in your MySQL daemon.") unless ssl_enabled
84+
pending("DON'T WORRY, THIS TEST PASSES - but you must update the SSL cert paths in this test and remove this pending state.")
8285
ssl_client = nil
8386
lambda {
8487
ssl_client = Mysql2::Client.new(

0 commit comments

Comments
 (0)