Skip to content

Commit

Permalink
Disable error_highlight when testing did_you_mean
Browse files Browse the repository at this point in the history
Fixes #160
  • Loading branch information
mame committed Aug 17, 2021
1 parent d8c4300 commit 93df310
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test_verbose_formatter.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
require_relative './helper'

class VerboseFormatterTest < Test::Unit::TestCase
class ErrorHighlightDummyFormatter
def message_for(spot)
""
end
end

def setup
require_relative File.join(DidYouMean::TestHelper.root, 'verbose')

DidYouMean.formatter = DidYouMean::VerboseFormatter.new

if defined?(ErrorHighlight)
@error_highlight_old_formatter = ErrorHighlight.formatter
ErrorHighlight.formatter = ErrorHighlightDummyFormatter.new
end
end

def teardown
DidYouMean.formatter = DidYouMean::PlainFormatter.new

if defined?(ErrorHighlight)
ErrorHighlight.formatter = @error_highlight_old_formatter
end
end

def test_message
Expand Down

0 comments on commit 93df310

Please sign in to comment.