From 8510ae1ca363df9061b6f55e5fb8baff9872089a Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Sun, 24 Apr 2022 13:42:31 +0300 Subject: [PATCH] draft! --- lib/rspec/core/configuration.rb | 5 +++++ lib/rspec/core/formatters/exception_presenter.rb | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/rspec/core/configuration.rb b/lib/rspec/core/configuration.rb index d44902449c..601de0f830 100644 --- a/lib/rspec/core/configuration.rb +++ b/lib/rspec/core/configuration.rb @@ -458,6 +458,11 @@ def shared_context_metadata_behavior=(value) # return [Integer] add_setting :max_displayed_failure_line_count + # @macro add_setting + # Skip bactrace for pending examples. + # return [Boolean] + add_setting :skip_backtrace_for_pending_examples + # Determines which bisect runner implementation gets used to run subsets # of the suite during a bisection. Your choices are: # diff --git a/lib/rspec/core/formatters/exception_presenter.rb b/lib/rspec/core/formatters/exception_presenter.rb index e90a769282..b081c59ac0 100644 --- a/lib/rspec/core/formatters/exception_presenter.rb +++ b/lib/rspec/core/formatters/exception_presenter.rb @@ -312,10 +312,12 @@ def pending_options ] } elsif @execution_result.status == :pending - { + options = { :message_color => RSpec.configuration.pending_color, - :detail_formatter => PENDING_DETAIL_FORMATTER + :detail_formatter => PENDING_DETAIL_FORMATTER, } + options[:backtrace_formatter] = EmptyBacktraceFormatter if RSpec.configuration.skip_backtrace_for_pending_examples + options end end