Method: RSpec::Core::Formatters::HtmlSnippetExtractor#snippet
- Defined in:
- lib/rspec/core/formatters/html_snippet_extractor.rb
permalink #snippet(backtrace) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Extract lines of code corresponding to a backtrace.
49 50 51 52 53 |
# File 'lib/rspec/core/formatters/html_snippet_extractor.rb', line 49 def snippet(backtrace) raw_code, line = snippet_for(backtrace[0]) highlighted = @@converter.convert(raw_code) post_process(highlighted, line) end |