ruby-changes:58309
From: Nobuyoshi <ko1@a...>
Date: Fri, 18 Oct 2019 16:48:14 +0900 (JST)
Subject: [ruby-changes:58309] e29e49abf0 (master): Default DidYouMean.formatter to PlainFormatter
https://git.ruby-lang.org/ruby.git/commit/?id=e29e49abf0 From e29e49abf018730d8419b4797ff17942e00d810b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 18 Oct 2019 16:43:40 +0900 Subject: Default DidYouMean.formatter to PlainFormatter diff --git a/test/optparse/test_did_you_mean.rb b/test/optparse/test_did_you_mean.rb index 2d0a9a6..82a086a 100644 --- a/test/optparse/test_did_you_mean.rb +++ b/test/optparse/test_did_you_mean.rb @@ -9,6 +9,11 @@ class TestOptionParser::DidYouMean < TestOptionParser https://github.com/ruby/ruby/blob/trunk/test/optparse/test_did_you_mean.rb#L9 @opt.def_option("--bar", Integer) { |v| @bar = v } @opt.def_option("--baz", Integer) { |v| @baz = v } @formatter = ::DidYouMean.formatter + case @formatter + when ::DidYouMean::PlainFormatter + else + ::DidYouMean.formatter = ::DidYouMean::PlainFormatter.new + end end def teardown @@ -22,7 +27,6 @@ class TestOptionParser::DidYouMean < TestOptionParser https://github.com/ruby/ruby/blob/trunk/test/optparse/test_did_you_mean.rb#L27 end def test_plain - ::DidYouMean.formatter = ::DidYouMean::PlainFormatter.new assert_raise_with_message(OptionParser::InvalidOption, /invalid option: --baa\nDid you mean\?\s+baz\s+bar\Z/) do @opt.permute!(%w"--baa") end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/