зеркало из https://github.com/github/ruby.git
[ruby/optparse] DidYouMean::PlainFormatter is deprecated
https://github.com/ruby/optparse/commit/0ac9957696
This commit is contained in:
Родитель
92630e2346
Коммит
743a41f7e3
|
@ -12,12 +12,20 @@ class TestOptionParser::DidYouMean < TestOptionParser
|
||||||
@opt.def_option("--foo", Integer) { |v| @foo = v }
|
@opt.def_option("--foo", Integer) { |v| @foo = v }
|
||||||
@opt.def_option("--bar", Integer) { |v| @bar = v }
|
@opt.def_option("--bar", Integer) { |v| @bar = v }
|
||||||
@opt.def_option("--baz", Integer) { |v| @baz = v }
|
@opt.def_option("--baz", Integer) { |v| @baz = v }
|
||||||
@formatter = ::DidYouMean.formatter
|
unless ::DidYouMean::Formatter.respond_to?(:message_for)
|
||||||
::DidYouMean.formatter = ::DidYouMean::Formatter
|
@formatter = ::DidYouMean.formatter
|
||||||
|
case @formatter
|
||||||
|
when ::DidYouMean::PlainFormatter
|
||||||
|
else
|
||||||
|
::DidYouMean.formatter = ::DidYouMean::PlainFormatter.new
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
::DidYouMean.formatter = @formatter
|
unless ::DidYouMean::Formatter.respond_to?(:message_for)
|
||||||
|
::DidYouMean.formatter = @formatter
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_no_suggestion
|
def test_no_suggestion
|
||||||
|
|
Загрузка…
Ссылка в новой задаче