class RSpec::Core::Formatters::SnippetExtractor
def snippet(backtrace)
- See: #post_process -
Returns:
-
(String)
- highlighted code snippet indicating where the test failure occured
Parameters:
-
backtrace
(String
) -- the backtrace from a test failure
Other tags:
- Api: - private
def snippet(backtrace) raw_code, line = snippet_for(backtrace[0]) highlighted = @@converter.convert(raw_code, false) highlighted << "\n<span class=\"comment\"># gem install syntax to get syntax highlighting</span>" if @@converter.is_a?(NullConverter) post_process(highlighted, line) end