mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 11:33:58 +02:00
Disable did_you_mean in TestPatternMatching
This commit is contained in:
parent
905be49bf6
commit
93badf4770
1 changed files with 19 additions and 0 deletions
|
@ -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!"
|
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__
|
eval "\n#{<<~'END_of_GUARD'}", binding, __FILE__, __LINE__
|
||||||
class TestPatternMatching < Test::Unit::TestCase
|
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 C
|
||||||
class << self
|
class << self
|
||||||
attr_accessor :keys
|
attr_accessor :keys
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue