diff options
author | Yuki Nishijima <[email protected]> | 2021-10-22 21:22:14 -0400 |
---|---|---|
committer | Yuki Nishijima <[email protected]> | 2021-10-22 21:22:14 -0400 |
commit | 93badf47704eece8b7a2b084f18a03a9083fb1a8 (patch) | |
tree | 39bc6f1039a0a0de5bf7844321a0c199ae1c46cc /test/ruby/test_pattern_matching.rb | |
parent | 905be49bf6b83f7dedb555f3f897f669cb16f1ad (diff) |
Disable did_you_mean in TestPatternMatching
Diffstat (limited to 'test/ruby/test_pattern_matching.rb')
-rw-r--r-- | test/ruby/test_pattern_matching.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index 277a0dcc51..35c41eb8b6 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -4,6 +4,25 @@ require 'test/unit' experimental, Warning[:experimental] = Warning[:experimental], false # suppress "warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!" eval "\n#{<<~'END_of_GUARD'}", binding, __FILE__, __LINE__ class TestPatternMatching < Test::Unit::TestCase + class NullFormatter + def message_for(corrections) + "" + end + end + + def setup + if defined?(DidYouMean) + @original_formatter = DidYouMean.formatter + DidYouMean.formatter = NullFormatter.new + end + end + + def teardown + if defined?(DidYouMean) + DidYouMean.formatter = @original_formatter + end + end + class C class << self attr_accessor :keys |