diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2021-08-17 10:52:10 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-09-28 17:48:57 +0900 |
commit | be51f4ce839c8a008178a1d757e7541922a00f7a (patch) | |
tree | e1bcce18def90dfffcd73215138dd7d891363504 /test | |
parent | fcaa918445c85c7b21d83f8eda2d237eace4b315 (diff) |
[ruby/did_you_mean] Disable error_highlight when testing did_you_mean
Fixes #160
https://github.com/ruby/did_you_mean/commit/93df310873
Diffstat (limited to 'test')
-rw-r--r-- | test/did_you_mean/test_verbose_formatter.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/did_you_mean/test_verbose_formatter.rb b/test/did_you_mean/test_verbose_formatter.rb index d8f2f46273..411f175180 100644 --- a/test/did_you_mean/test_verbose_formatter.rb +++ b/test/did_you_mean/test_verbose_formatter.rb @@ -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 |