BigW Consortium Gitlab

rspec_profiling.rb 425 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
module RspecProfilingConnection
  def establish_connection
    ::RspecProfiling::Collectors::PSQL::Result.establish_connection(ENV['RSPEC_PROFILING_POSTGRES_URL'])
  end
end

if Rails.env.test?
  RspecProfiling.configure do |config|
    if ENV['RSPEC_PROFILING_POSTGRES_URL']
      RspecProfiling::Collectors::PSQL.prepend(RspecProfilingConnection)
      config.collector = RspecProfiling::Collectors::PSQL
    end
  end
end