Sha256: 6e1de8a3ea883c154fdda663419dd1d896cec45153ae9af1de2442c9b29edd83
Contents?: true
Size: 905 Bytes
Versions: 21
Compression:
Stored size: 905 Bytes
Contents
# frozen_string_literal: true require 'rubygems' require 'bundler/setup' require 'active_record' require_relative '../lib/rails-pg-extras' pg_version = ENV["PG_VERSION"] port = if pg_version == "11" "5432" elsif pg_version == "12" "5433" elsif pg_version == "13" "5434" elsif pg_version == "14" "5435" else "5432" end ENV["DATABASE_URL"] ||= "postgresql://postgres:secret@localhost:#{port}/rails-pg-extras-test" RSpec.configure do |config| config.before :suite do ActiveRecord::Base.establish_connection( ENV.fetch("DATABASE_URL") ) RailsPgExtras.connection.execute("CREATE EXTENSION IF NOT EXISTS pg_stat_statements;") RailsPgExtras.connection.execute("CREATE EXTENSION IF NOT EXISTS pg_buffercache;") RailsPgExtras.connection.execute("CREATE EXTENSION IF NOT EXISTS sslinfo;") end config.after :suite do ActiveRecord::Base.remove_connection end end
Version data entries
21 entries across 21 versions & 1 rubygems