summaryrefslogtreecommitdiff
path: root/test/optparse
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-18 17:46:53 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-18 17:46:53 +0900
commite2b719bed640d4813fd5f753c80d33d01c612078 (patch)
tree7435050481f41ef13a893261d53e9600cf195286 /test/optparse
parentb4d308b41939659fe8a4df28afc82eb5205709d1 (diff)
Support DidYouMean by AmbiguousOption too
Diffstat (limited to 'test/optparse')
-rw-r--r--test/optparse/test_did_you_mean.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/optparse/test_did_you_mean.rb b/test/optparse/test_did_you_mean.rb
index 82a086a..19bb4b9 100644
--- a/test/optparse/test_did_you_mean.rb
+++ b/test/optparse/test_did_you_mean.rb
@@ -39,4 +39,10 @@ class TestOptionParser::DidYouMean < TestOptionParser
@opt.permute!(%w"--baa")
end
end
+
+ def test_ambiguos
+ assert_raise_with_message(OptionParser::AmbiguousOption, /ambiguous option: --ba\nDid you mean\?\s+baz\s+bar\Z/) do
+ @opt.permute!(%w"--ba")
+ end
+ end
end