Class: RSpec::Core::Formatters::ExceptionPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/turnip_documentation_formatter.rb

Overview

Highlight error step in summary description

Instance Method Summary collapse

Instance Method Details

#encoded_description(description) ⇒ Object



115
116
117
118
119
120
121
122
123
124
125
# File 'lib/turnip_documentation_formatter.rb', line 115

def encoded_description(description)
  return if description.nil?

  if example.[:turnip] && example.[:failed_step]
    step = example.[:failed_step].to_s
    error = ::RSpec::Core::Formatters::ConsoleCodes.wrap(step, :failure)
    description = description.gsub(step, error)
  end

  encoded_string(description)
end