require_relative '../factories/pg_connection'

shared_context "cdb_importer schema" do

  before do
    pg_connection = CartoDB::Importer2::Factories::PGConnection.new
    @db = pg_connection.connection
    @pg_options  = pg_connection.pg_options
    @db.execute('CREATE SCHEMA IF NOT EXISTS cdb_importer')
  end

  after(:each) do
    @db.execute('DROP SCHEMA cdb_importer CASCADE')
    @db.disconnect
  end

end
require_relative '../factories/pg_connection'

shared_context "cdb_importer schema" do

  before do
    pg_connection = CartoDB::Importer2::Factories::PGConnection.new
    @db = pg_connection.connection
    @pg_options  = pg_connection.pg_options
    @db.execute('CREATE SCHEMA IF NOT EXISTS cdb_importer')

    @db.execute('CREATE EXTENSION IF NOT EXISTS postgis')
    @db.execute('CREATE EXTENSION IF NOT EXISTS postgis_topology')
  end

  after(:each) do
    @db.execute('DROP SCHEMA cdb_importer CASCADE')
    @db.disconnect
  end

end
Install postgis and postgis_topology if they don't exist (in a cleaner way)
Install postgis and postgis_topology if they don't exist (in a cleaner way)
