Sha256: e83c2f6d66f7b6f29efd3cf339df7427fcf4004139d7225b82e83356b3967292

Contents?: true

Size: 447 Bytes

Versions: 2

Compression:

Stored size: 447 Bytes

Contents

require 'sequel'

module RSpec::Sequel::Test
  
  def self.postgres
    @pg_db ||= connect_to_postgres
  end
  
  private
  DEFAULT_TEST_DATABASE = 'postgres:///rspec-sequel-test'

  def self.connect_to_postgres
    test_database = unless ENV['TEST_DATABASE']
      STDERR.puts "TEST_DATABASE environment variable not found, defaulting to #{DEFAULT_TEST_DATABASE}"
      DEFAULT_TEST_DATABASE
    end

    Sequel::connect test_database
  end

end

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
rspec-sequel-0.0.1 features/support/postgres.rb
rspec-sequel-0.0.1 spec/support/postgres.rb