Skip to content

Commit

Permalink
Add ruby-level test for native password
Browse files Browse the repository at this point in the history
  • Loading branch information
ngan committed Apr 5, 2024
1 parent e9a4c65 commit 79e5e56
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions contrib/ruby/test/auth_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@

class AuthTest < TrilogyTest
def test_cleartext_auth_plugin
client = new_tcp_client username: "cleartext_user", password: "password", enable_cleartext_plugin: true
client = new_tcp_client(username: "cleartext_user", password: "password", enable_cleartext_plugin: true)
refute_nil client
ensure
ensure_closed client
end

def test_cleartext_auth_plugin_disabled
assert_raises Trilogy::AuthPluginError do
new_tcp_client username: "cleartext_user", password: "password"
assert_raises(Trilogy::AuthPluginError) do
new_tcp_client(username: "cleartext_user", password: "password")
end
end

def test_mysql_native_password
client = new_tcp_client(username: "native", password: "")
refute_nil client
ensure
ensure_closed client
end
end

0 comments on commit 79e5e56

Please sign in to comment.