From 0e97793f9196279ef44d327571cf31617da2195e Mon Sep 17 00:00:00 2001 From: nandahkrishna Date: Sun, 14 Mar 2021 01:39:14 +0530 Subject: [PATCH] test/completions: modify tests for zsh completions --- Library/Homebrew/test/completions_spec.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/test/completions_spec.rb b/Library/Homebrew/test/completions_spec.rb index c3b9ad9632..cadc966bb8 100644 --- a/Library/Homebrew/test/completions_spec.rb +++ b/Library/Homebrew/test/completions_spec.rb @@ -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