X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=test%2Fmailshears_test.rb;fp=test%2Fmailshears_test.rb;h=22c634f43b643b41c3764f21ec79fbaf5bc1c186;hp=94f2f4903bd7894b505fa21e8a3ff340503ba668;hb=853aaef812f6e23f17d3e24db99dfbaadafdbddf;hpb=fa7782720ff15fce29b6f875678e9fd0c197485a diff --git a/test/mailshears_test.rb b/test/mailshears_test.rb index 94f2f49..22c634f 100644 --- a/test/mailshears_test.rb +++ b/test/mailshears_test.rb @@ -32,16 +32,15 @@ class MailshearsTest < MiniTest::Test # Connect to the database (specified in the test configuration) as # the superuser. Your local configuration is expected to be such # that this "just works." - db_host = 'localhost' - db_port = 5432 - db_opts = nil - db_tty = nil - db_name = 'postgres' - db_user = 'postgres' - db_pass = nil - - connection = PG::Connection.new(db_host, db_port, db_opts, db_tty, - db_name, db_user, db_pass) + db_hash = { + :host => 'localhost', + :port => 5432, + :options => nil, + :dbname => 'postgres', + :user => 'postgres', + :password => nil + } + connection = PG::Connection.new(db_hash) return connection end @@ -210,17 +209,16 @@ class MailshearsTest < MiniTest::Test query = "CREATE DATABASE #{plugin_dbname};" connection.sync_exec(query) - plugin_dbhost = cfg.send("#{plugin}_dbhost") - plugin_dbport = cfg.send("#{plugin}_dbport") - plugin_dbopts = cfg.send("#{plugin}_dbopts") - plugin_dbtty = cfg.send("#{plugin}_dbtty") - plugin_dbuser = cfg.send("#{plugin}_dbuser") - plugin_dbpass = cfg.send("#{plugin}_dbpass") + plugin_dbhash = { + :host => cfg.send("#{plugin}_dbhost"), + :port => cfg.send("#{plugin}_dbport"), + :options => cfg.send("#{plugin}_dbopts"), + :dbname => plugin_dbname, + :user => cfg.send("#{plugin}_dbuser"), + :password => cfg.send("#{plugin}_dbpass") + } - plugin_conn = PG::Connection.new(plugin_dbhost, plugin_dbport, - plugin_dbopts, plugin_dbtty, - plugin_dbname, plugin_dbuser, - plugin_dbpass) + plugin_conn = PG::Connection.new(plugin_dbhash) sql = File.open("test/sql/#{plugin}.sql").read() plugin_conn.sync_exec(sql)