Skip to content

Commit be51f4c

Browse files
mamehsbt
authored andcommitted
[ruby/did_you_mean] Disable error_highlight when testing did_you_mean
Fixes #160 ruby/did_you_mean@93df310873
1 parent fcaa918 commit be51f4c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/did_you_mean/test_verbose_formatter.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
require_relative './helper'
22

33
class VerboseFormatterTest < Test::Unit::TestCase
4+
class ErrorHighlightDummyFormatter
5+
def message_for(spot)
6+
""
7+
end
8+
end
9+
410
def setup
511
require_relative File.join(DidYouMean::TestHelper.root, 'verbose')
612

713
DidYouMean.formatter = DidYouMean::VerboseFormatter.new
14+
15+
if defined?(ErrorHighlight)
16+
@error_highlight_old_formatter = ErrorHighlight.formatter
17+
ErrorHighlight.formatter = ErrorHighlightDummyFormatter.new
18+
end
819
end
920

1021
def teardown
1122
DidYouMean.formatter = DidYouMean::PlainFormatter.new
23+
24+
if defined?(ErrorHighlight)
25+
ErrorHighlight.formatter = @error_highlight_old_formatter
26+
end
1227
end
1328

1429
def test_message

0 commit comments

Comments
 (0)