-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
spec_helper.rb
43 lines (33 loc) 路 959 Bytes
/
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
# frozen_string_literal: true
require "simplecov"
SimpleCov.start do
add_filter "/vendor/"
minimum_coverage 10
end
# Setup Sorbet for usage in stubs.
require "sorbet-runtime"
class Module
include T::Sig
end
PROJECT_ROOT = Pathname(__dir__).parent.freeze
STUB_PATH = (PROJECT_ROOT/"spec/stub").freeze
$LOAD_PATH.unshift(STUB_PATH)
Dir.glob("#{PROJECT_ROOT}/lib/**/*.rb").each do |file|
require file
end
require "global"
require "active_support/core_ext/object/blank"
SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter]
require "bundler"
require "rspec/support/object_formatter"
RSpec.configure do |config|
config.filter_run_when_matching :focus
config.expect_with :rspec do |c|
c.max_formatted_output_length = 200
end
# Never truncate output objects.
RSpec::Support::ObjectFormatter.default_instance.max_formatted_output_length = nil
config.around do |example|
Bundler.with_original_env { example.run }
end
end