Detailed output when running only one spec file

This commit is contained in:
Maikel Linke
2024-05-09 11:16:48 +10:00
parent 6317fe1b71
commit 8362c4a7bd

View File

@@ -129,6 +129,16 @@ RSpec.configure do |config|
# https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/
config.disable_monkey_patching!
# Many RSpec users commonly either run the entire suite or an individual
# file, and it's useful to allow more verbose output when running an
# individual spec file.
if config.files_to_run.one?
# Use the documentation formatter for detailed output,
# unless a formatter has already been configured
# (e.g. via a command-line flag).
config.default_formatter = "doc"
end
# Reset locale for all specs.
config.around(:each) do |example|
I18n.with_locale(:en) { example.run }