lib,test: replace connection query() method with sync_exec{,_params}.
[mailshears.git] / test / mailshears_test.rb
index 2b653ede18100dc64e4afcaaaef3f757ebc8b8f6..94f2f4903bd7894b505fa21e8a3ff340503ba668 100644 (file)
@@ -208,7 +208,7 @@ class MailshearsTest < MiniTest::Test
       plugin_dbname = cfg.send("#{plugin}_dbname")
       next if plugin_dbname.nil? # Skip the dovecot plugin
       query = "CREATE DATABASE #{plugin_dbname};"
-      connection.query(query)
+      connection.sync_exec(query)
 
       plugin_dbhost = cfg.send("#{plugin}_dbhost")
       plugin_dbport = cfg.send("#{plugin}_dbport")
@@ -223,9 +223,9 @@ class MailshearsTest < MiniTest::Test
                                        plugin_dbpass)
 
       sql = File.open("test/sql/#{plugin}.sql").read()
-      plugin_conn.query(sql)
+      plugin_conn.sync_exec(sql)
       sql = File.open("test/sql/#{plugin}-fixtures.sql").read()
-      plugin_conn.query(sql)
+      plugin_conn.sync_exec(sql)
       plugin_conn.close()
     end
 
@@ -246,7 +246,7 @@ class MailshearsTest < MiniTest::Test
       plugin_dbname = cfg.send("#{plugin}_dbname")
       next if plugin_dbname.nil? # Skip the dovecot plugin
       query = "DROP DATABASE IF EXISTS #{plugin_dbname};"
-      connection.query(query)
+      connection.sync_exec(query)
     end
 
     connection.close()