[前][次][番号順一覧][スレッド一覧]

ruby-changes:69350

From: Yuki <ko1@a...>
Date: Sat, 23 Oct 2021 10:23:05 +0900 (JST)
Subject: [ruby-changes:69350] 93badf4770 (master): Disable did_you_mean in TestPatternMatching

https://git.ruby-lang.org/ruby.git/commit/?id=93badf4770

From 93badf47704eece8b7a2b084f18a03a9083fb1a8 Mon Sep 17 00:00:00 2001
From: Yuki Nishijima <yk.nishijima@g...>
Date: Fri, 22 Oct 2021 21:22:14 -0400
Subject: Disable did_you_mean in TestPatternMatching

---
 test/ruby/test_pattern_matching.rb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

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' https://github.com/ruby/ruby/blob/trunk/test/ruby/test_pattern_matching.rb#L4
 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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]