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

Version Path
rails-pg-extras-5.3.1 spec/spec_helper.rb
rails-pg-extras-5.3.0 spec/spec_helper.rb
rails-pg-extras-5.2.5 spec/spec_helper.rb
rails-pg-extras-5.2.4 spec/spec_helper.rb
rails-pg-extras-5.2.3 spec/spec_helper.rb
rails-pg-extras-5.2.2 spec/spec_helper.rb
rails-pg-extras-5.2.1 spec/spec_helper.rb
rails-pg-extras-5.2.0 spec/spec_helper.rb
rails-pg-extras-5.1.0 spec/spec_helper.rb
rails-pg-extras-5.0.0 spec/spec_helper.rb
rails-pg-extras-4.13.0 spec/spec_helper.rb
rails-pg-extras-4.12.2 spec/spec_helper.rb
rails-pg-extras-4.12.1 spec/spec_helper.rb
rails-pg-extras-4.12.0 spec/spec_helper.rb
rails-pg-extras-4.10.0 spec/spec_helper.rb
rails-pg-extras-4.9.0 spec/spec_helper.rb
rails-pg-extras-4.8.1 spec/spec_helper.rb
rails-pg-extras-4.7.2 spec/spec_helper.rb
rails-pg-extras-4.7.1 spec/spec_helper.rb
rails-pg-extras-4.7.0 spec/spec_helper.rb