From 8362c4a7bda8a263f44e52ea1e31f9851744ad1a Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 9 May 2024 11:16:48 +1000 Subject: [PATCH] Detailed output when running only one spec file --- spec/base_spec_helper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index bfa70791e5..11e2fae0ee 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -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 }