2019-07-25 01:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-08-23 05:09:29 -04:00
|
|
|
require_relative "rspec_order"
|
2022-09-12 17:10:38 -04:00
|
|
|
require_relative "system_exit_detected"
|
2018-03-29 05:47:54 -04:00
|
|
|
require_relative "helpers/stub_configuration"
|
2018-07-23 09:13:11 -04:00
|
|
|
require_relative "helpers/stub_metrics"
|
2018-03-29 05:47:54 -04:00
|
|
|
require_relative "helpers/stub_object_storage"
|
|
|
|
require_relative "helpers/stub_env"
|
2020-07-01 08:09:08 -04:00
|
|
|
require_relative "helpers/fast_rails_root"
|
2020-11-05 13:08:48 -05:00
|
|
|
|
2022-05-06 08:09:05 -04:00
|
|
|
RSpec::Expectations.configuration.on_potential_false_positives = :raise
|
|
|
|
|
2018-03-29 05:47:54 -04:00
|
|
|
RSpec.configure do |config|
|
2022-09-14 11:12:56 -04:00
|
|
|
# Re-run failures locally with `--only-failures`
|
|
|
|
config.example_status_persistence_file_path = ENV.fetch('RSPEC_LAST_RUN_RESULTS_FILE', './spec/examples.txt')
|
|
|
|
|
2022-09-15 02:12:51 -04:00
|
|
|
unless ENV['CI']
|
|
|
|
# Allow running `:focus` examples locally,
|
|
|
|
# falling back to all tests when there is no `:focus` example.
|
|
|
|
config.filter_run focus: true
|
|
|
|
config.run_all_when_everything_filtered = true
|
|
|
|
end
|
|
|
|
|
2021-11-18 07:13:46 -05:00
|
|
|
config.mock_with :rspec do |mocks|
|
|
|
|
mocks.verify_doubled_constant_names = true
|
|
|
|
end
|
|
|
|
|
2018-03-29 05:47:54 -04:00
|
|
|
config.raise_errors_for_deprecations!
|
|
|
|
|
|
|
|
config.include StubConfiguration
|
2018-07-23 09:13:11 -04:00
|
|
|
config.include StubMetrics
|
2018-03-29 05:47:54 -04:00
|
|
|
config.include StubObjectStorage
|
|
|
|
config.include StubENV
|
2020-07-01 08:09:08 -04:00
|
|
|
config.include FastRailsRoot
|
2018-03-29 05:47:54 -04:00
|
|
|
end
|