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