Sha256: f375d4444a7dfdc8d18ef0e68cbb0e5048761982fad520a2a2bbba26c5e8b7e6

Contents?: true

Size: 1011 Bytes

Versions: 4

Compression:

Stored size: 1011 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe RubyPGExtras do
  before(:all) do
    RubyPGExtras.connection.exec("CREATE EXTENSION IF NOT EXISTS pg_buffercache;")
    RubyPGExtras.connection.exec("CREATE EXTENSION IF NOT EXISTS pg_stat_statements;")
  end

  RubyPGExtras::QUERIES.each do |query_name|
    it "#{query_name} description can be read" do
      expect do
        RubyPGExtras.description_for(
          query_name: query_name
        )
      end.not_to raise_error
    end
  end

  RubyPGExtras::QUERIES.each do |query_name|
    it "#{query_name} query can be executed" do
      expect do
        RubyPGExtras.run_query(
          query_name: query_name,
          in_format: :hash
        )
      end.not_to raise_error
    end
  end

  describe "#database_url=" do
    it "setting custom database URL works" do
      RubyPGExtras.database_url = ENV.fetch("DATABASE_URL")
      expect do
        RubyPGExtras.bloat(in_format: :hash)
      end.not_to raise_error
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-pg-extras-2.3.0 spec/smoke_spec.rb
ruby-pg-extras-2.2.0 spec/smoke_spec.rb
ruby-pg-extras-2.1.0 spec/smoke_spec.rb
ruby-pg-extras-2.0.0 spec/smoke_spec.rb