Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit a44c83b

Browse files
committed
unnecessary one-liner
1 parent 2250694 commit a44c83b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/rspec/core/formatters/snippet_extractor.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ module Formatters
44
# This class extracts code snippets by looking at the backtrace of the passed error
55
class SnippetExtractor #:nodoc:
66
class NullConverter; def convert(code, pre); code; end; end #:nodoc:
7-
begin; require 'syntax/convertors/html'; @@converter = Syntax::Convertors::HTML.for_syntax "ruby"; rescue LoadError => e; @@converter = NullConverter.new; end
7+
8+
begin
9+
require 'syntax/convertors/html'
10+
@@converter = Syntax::Convertors::HTML.for_syntax "ruby"
11+
rescue LoadError => e
12+
@@converter = NullConverter.new
13+
end
814

915
def snippet(error)
1016
raw_code, line = snippet_for(error.backtrace[0])

0 commit comments

Comments
 (0)