Skip to content

Commit

Permalink
test/optparse/test_did_you_mean.rb - fix suggestion order
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg authored and nobu committed Oct 21, 2019
1 parent 2726100 commit 71ffe40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/optparse/test_did_you_mean.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ def test_no_suggestion
end

def test_plain
assert_raise_with_message(OptionParser::InvalidOption, /invalid option: --baa\nDid you mean\?\s+baz\s+bar\Z/) do
assert_raise_with_message(OptionParser::InvalidOption, /invalid option: --baa\nDid you mean\?\s+bar\s+baz\Z/) do
@opt.permute!(%w"--baa")
end
end

def test_verbose
require 'did_you_mean/formatters/verbose_formatter'
::DidYouMean.formatter = ::DidYouMean::VerboseFormatter.new
assert_raise_with_message(OptionParser::InvalidOption, /invalid option: --baa\n\s+Did you mean\?\s+baz\s+bar\s*\Z/) do
assert_raise_with_message(OptionParser::InvalidOption, /invalid option: --baa\n\s+Did you mean\?\s+bar\s+baz\s*\Z/) do
@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
assert_raise_with_message(OptionParser::AmbiguousOption, /ambiguous option: --ba\nDid you mean\?\s+bar\s+baz\Z/) do
@opt.permute!(%w"--ba")
end
end
Expand Down

0 comments on commit 71ffe40

Please sign in to comment.