12 lines
413 B
Ruby
12 lines
413 B
Ruby
class SpecDb
|
|
|
|
TEST_DB_NAME="jam_ruby_test"
|
|
|
|
def self.recreate_database
|
|
conn = PG::Connection.open("dbname=postgres user=postgres password=postgres host=localhost")
|
|
conn.exec("DROP DATABASE IF EXISTS #{TEST_DB_NAME}")
|
|
conn.exec("CREATE DATABASE #{TEST_DB_NAME}")
|
|
JamDb::Migrator.new.migrate(:dbname => TEST_DB_NAME, :user => "postgres", :password => "postgres", :host => "localhost")
|
|
end
|
|
end
|