spec/support/database.rb in pg_search-2.3.5 vs spec/support/database.rb in pg_search-2.3.6
- old
+ new
@@ -8,13 +8,15 @@
require "pg"
ERROR_CLASS = PG::Error
end
begin
- ActiveRecord::Base.establish_connection(adapter: 'postgresql',
- database: 'pg_search_test',
- username: (ENV["TRAVIS"] ? "postgres" : ENV["USER"]),
- min_messages: 'warning')
+ connection_options = { adapter: 'postgresql', database: 'pg_search_test', min_messages: 'warning' }
+ if ENV["CI"]
+ connection_options[:username] = 'postgres'
+ connection_options[:password] = 'postgres'
+ end
+ ActiveRecord::Base.establish_connection(connection_options)
connection = ActiveRecord::Base.connection
connection.execute("SELECT 1")
rescue ERROR_CLASS, ActiveRecord::NoDatabaseError => e
at_exit do
puts "-" * 80