mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/error_highlight] Make the formatter mechanism support Ractor
Now the formatter configuration is per Ractor. DefaultFormatter is used
if not set.
DefaultFormatter#message_for is now a class method to allow sub-Ractors
to call the method.
9fbaa8ab7c
This commit is contained in:
parent
33844f3096
commit
4c32fcb84f
2 changed files with 5 additions and 7 deletions
|
@ -5,7 +5,7 @@ require "tempfile"
|
|||
|
||||
class ErrorHighlightTest < Test::Unit::TestCase
|
||||
class DummyFormatter
|
||||
def message_for(corrections)
|
||||
def self.message_for(corrections)
|
||||
""
|
||||
end
|
||||
end
|
||||
|
@ -13,7 +13,7 @@ class ErrorHighlightTest < Test::Unit::TestCase
|
|||
def setup
|
||||
if defined?(DidYouMean)
|
||||
@did_you_mean_old_formatter = DidYouMean.formatter
|
||||
DidYouMean.formatter = DummyFormatter.new
|
||||
DidYouMean.formatter = DummyFormatter
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue