mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/did_you_mean] Disable error_highlight when testing did_you_mean
Fixes #160 https://github.com/ruby/did_you_mean/commit/93df310873
This commit is contained in:
parent
fcaa918445
commit
be51f4ce83
1 changed files with 15 additions and 0 deletions
|
@ -1,14 +1,29 @@
|
||||||
require_relative './helper'
|
require_relative './helper'
|
||||||
|
|
||||||
class VerboseFormatterTest < Test::Unit::TestCase
|
class VerboseFormatterTest < Test::Unit::TestCase
|
||||||
|
class ErrorHighlightDummyFormatter
|
||||||
|
def message_for(spot)
|
||||||
|
""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
require_relative File.join(DidYouMean::TestHelper.root, 'verbose')
|
require_relative File.join(DidYouMean::TestHelper.root, 'verbose')
|
||||||
|
|
||||||
DidYouMean.formatter = DidYouMean::VerboseFormatter.new
|
DidYouMean.formatter = DidYouMean::VerboseFormatter.new
|
||||||
|
|
||||||
|
if defined?(ErrorHighlight)
|
||||||
|
@error_highlight_old_formatter = ErrorHighlight.formatter
|
||||||
|
ErrorHighlight.formatter = ErrorHighlightDummyFormatter.new
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
DidYouMean.formatter = DidYouMean::PlainFormatter.new
|
DidYouMean.formatter = DidYouMean::PlainFormatter.new
|
||||||
|
|
||||||
|
if defined?(ErrorHighlight)
|
||||||
|
ErrorHighlight.formatter = @error_highlight_old_formatter
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_message
|
def test_message
|
||||||
|
|
Loading…
Add table
Reference in a new issue