-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathspec_helper.rb
38 lines (30 loc) · 950 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
# frozen_string_literal: true
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
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.shared_context_metadata_behavior = :apply_to_host_groups
config.warnings = true
config.order = :random
end
require 'tomlib'
if GC.respond_to?(:verify_compaction_references)
# This method was added in Ruby 3.0.0. Calling it this way asks the GC to
# move objects around, helping to find object movement bugs.
begin
begin
GC.verify_compaction_references(expand_heap: true, toward: :empty)
rescue ArgumentError
GC.verify_compaction_references(double_heap: true, toward: :empty)
end
rescue NotImplementedError
# Some platforms don't support compaction
end
end