-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathspec_helper.rb
55 lines (44 loc) · 1.27 KB
/
spec_helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# frozen_string_literal: true
require 'byebug' if Gem.loaded_specs['byebug']
if Gem.loaded_specs['simplecov'] && (ENV.fetch('COVERAGE', nil) || ENV.fetch('CI', nil))
require 'simplecov'
if ENV['CI']
require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end
SimpleCov.start do
enable_coverage :branch
add_filter '/spec/'
add_filter '/vendor/'
end
end
require 'faulty'
require 'faulty/patch/redis'
require 'faulty/patch/elasticsearch'
require 'timecop'
require 'redis'
require 'json'
require 'connection_pool'
begin
# We don't test Mysql2 on Ruby 2.3 since that would require
# installing an old EOL version of OpenSSL
require 'faulty/patch/mysql2' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4')
rescue LoadError
# Ok if mysql2 isn't available
end
require_relative 'support/concurrency'
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.disable_monkey_patching!
config.warnings = false
config.after do
Timecop.return
Faulty.enable!
end
config.include Faulty::Specs::Concurrency
end