test/completions: modify tests for zsh completions

This commit is contained in:
nandahkrishna 2021-03-14 01:39:14 +05:30
parent 4a4b415186
commit 0e97793f91
No known key found for this signature in database
GPG Key ID: 067E5FCD58ADF3AA

View File

@ -321,7 +321,8 @@ describe Homebrew::Completions do
'--hide[Act as if none of the specified hidden are installed. hidden should be a comma-separated list of formulae]' \\
'--quiet[Make some output more quiet]' \\
'--verbose[Make some output more verbose]' \\
'::formula:__brew_formulae'
- formula \\
'*::formula:__brew_formulae'
}
COMPLETION
end
@ -343,9 +344,12 @@ describe Homebrew::Completions do
end
it "returns appropriate completion for a command with multiple named arg types" do
completion = described_class.generate_zsh_subcommand_completion("upgrade")
completion = described_class.generate_zsh_subcommand_completion("livecheck")
expect(completion).to match(
/'::outdated_formula:__brew_outdated_formulae' \\\n '::outdated_cask:__brew_outdated_casks'\n}$/,
/'*::formula:__brew_formulae'/,
)
expect(completion).to match(
/'*::cask:__brew_casks'\n}$/,
)
end
end