Commit 64f63d6c4f18cabe9935886cedd401255eebe2f9
1 parent
69af51e3
Exists in
master
and in
17 other branches
More test cleanup
Showing
1 changed file
with
11 additions
and
12 deletions
Show diff stats
test/test_helper.rb
... | ... | @@ -6,14 +6,15 @@ require "logger" |
6 | 6 | require "active_support/core_ext" if defined?(NoBrainer) |
7 | 7 | require "active_support/notifications" |
8 | 8 | |
9 | -Searchkick.index_suffix = ENV["TEST_ENV_NUMBER"] # for parallel tests | |
10 | - | |
11 | 9 | ENV["RACK_ENV"] = "test" |
12 | 10 | |
13 | 11 | $logger = ActiveSupport::Logger.new(ENV["VERBOSE"] ? STDOUT : nil) |
14 | 12 | |
15 | 13 | Searchkick.client.transport.logger = $logger |
16 | 14 | Searchkick.search_timeout = 5 |
15 | +Searchkick.index_suffix = ENV["TEST_ENV_NUMBER"] # for parallel tests | |
16 | + | |
17 | +puts "Running against Elasticsearch #{Searchkick.server_version}" | |
17 | 18 | |
18 | 19 | if defined?(Redis) |
19 | 20 | if defined?(ConnectionPool) |
... | ... | @@ -23,8 +24,6 @@ if defined?(Redis) |
23 | 24 | end |
24 | 25 | end |
25 | 26 | |
26 | -puts "Running against Elasticsearch #{Searchkick.server_version}" | |
27 | - | |
28 | 27 | I18n.config.enforce_available_locales = true |
29 | 28 | |
30 | 29 | if defined?(ActiveJob) |
... | ... | @@ -34,14 +33,6 @@ end |
34 | 33 | |
35 | 34 | ActiveSupport::LogSubscriber.logger = ActiveSupport::Logger.new(STDOUT) if ENV["NOTIFICATIONS"] |
36 | 35 | |
37 | -def nobrainer? | |
38 | - defined?(NoBrainer) | |
39 | -end | |
40 | - | |
41 | -def cequel? | |
42 | - defined?(Cequel) | |
43 | -end | |
44 | - | |
45 | 36 | if defined?(Mongoid) |
46 | 37 | require_relative "support/mongoid" |
47 | 38 | elsif defined?(NoBrainer) |
... | ... | @@ -124,4 +115,12 @@ class Minitest::Test |
124 | 115 | klass.searchkick_options.merge!(previous_options) |
125 | 116 | end |
126 | 117 | end |
118 | + | |
119 | + def nobrainer? | |
120 | + defined?(NoBrainer) | |
121 | + end | |
122 | + | |
123 | + def cequel? | |
124 | + defined?(Cequel) | |
125 | + end | |
127 | 126 | end | ... | ... |