Skip to content

Commit

Permalink
More test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Sep 28, 2018
1 parent 69af51e commit 64f63d6
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions test/test_helper.rb
Expand Up @@ -6,14 +6,15 @@
require "active_support/core_ext" if defined?(NoBrainer)
require "active_support/notifications"

Searchkick.index_suffix = ENV["TEST_ENV_NUMBER"] # for parallel tests

ENV["RACK_ENV"] = "test"

$logger = ActiveSupport::Logger.new(ENV["VERBOSE"] ? STDOUT : nil)

Searchkick.client.transport.logger = $logger
Searchkick.search_timeout = 5
Searchkick.index_suffix = ENV["TEST_ENV_NUMBER"] # for parallel tests

puts "Running against Elasticsearch #{Searchkick.server_version}"

if defined?(Redis)
if defined?(ConnectionPool)
Expand All @@ -23,8 +24,6 @@
end
end

puts "Running against Elasticsearch #{Searchkick.server_version}"

I18n.config.enforce_available_locales = true

if defined?(ActiveJob)
Expand All @@ -34,14 +33,6 @@

ActiveSupport::LogSubscriber.logger = ActiveSupport::Logger.new(STDOUT) if ENV["NOTIFICATIONS"]

def nobrainer?
defined?(NoBrainer)
end

def cequel?
defined?(Cequel)
end

if defined?(Mongoid)
require_relative "support/mongoid"
elsif defined?(NoBrainer)
Expand Down Expand Up @@ -124,4 +115,12 @@ def with_options(klass, options)
klass.searchkick_options.merge!(previous_options)
end
end

def nobrainer?
defined?(NoBrainer)
end

def cequel?
defined?(Cequel)
end
end

0 comments on commit 64f63d6

Please sign in to comment.