From 9de6a1c2cb7c96638179aed0052ee6dd17eaa49a Mon Sep 17 00:00:00 2001 From: Andreas Scherer Date: Wed, 25 Dec 2024 10:36:16 +0100 Subject: [PATCH] Partial solution for cask processing. --- Library/Homebrew/test/cmd/list_spec.rb | 35 ++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Library/Homebrew/test/cmd/list_spec.rb b/Library/Homebrew/test/cmd/list_spec.rb index 9ac7cc0b63072..23e5a8b10510b 100644 --- a/Library/Homebrew/test/cmd/list_spec.rb +++ b/Library/Homebrew/test/cmd/list_spec.rb @@ -13,35 +13,38 @@ formulae.each do |f| (HOMEBREW_CELLAR/f/"1.0/somedir").mkpath end - # casks.each do |f| - # (HOMEBREW_CELLAR/"../Caskroom"/f/"42.0/somedir").mkpath - # end + casks.each do |f| + (HOMEBREW_PREFIX/"Caskroom"/f/"42.0/somedir").mkpath + end expect { brew "list", "--formula" } .to output("#{formulae.sort.join("\n")}\n").to_stdout .and not_to_output.to_stderr .and be_a_success - # expect { brew "list", "--cask" } - # .to output("#{casks.sort.join("\n")}\n").to_stdout - # .and not_to_output.to_stderr - # .and be_a_success + expect { brew "list", "--cask" } + .to output("#{casks.sort.join("\n")}\n").to_stdout + .and not_to_output.to_stderr + .and be_a_success expect { brew "list", "--formula", "--version" } .to output("#{formulae.sort.map { |name| "#{name} 1.0" }.join("\n")}\n").to_stdout .and not_to_output.to_stderr .and be_a_success - # expect { brew "list", "--cask", "--version" } - # .to output("#{casks.sort.map { |name| "#{name} 42.0" }.join("\n")}\n").to_stdout - # .and not_to_output.to_stderr - # .and be_a_success + expect { brew "list", "--cask", "--version" } + .to output("#{casks.sort.map { |name| "#{name} 42.0" }.join("\n")}\n").to_stdout + .and not_to_output.to_stderr + .and be_a_success - # expect { brew "list", "--version" } - # .to output("#{formulae.sort.map { |name| "#{name} 1.0" }.join("\n")}\n" + - # "#{casks.sort.map { |name| "#{name} 42.0" }.join("\n")}\n").to_stdout - # .and not_to_output.to_stderr - # .and be_a_success + expect { brew "list", "--version" } + .to output(<<~OUTPUT, + #{formulae.sort.map { |name| "#{name} 1.0" }.join("\n")} + #{casks.sort.map { |name| "#{name} 42.0" }.join("\n")} + OUTPUT + ).to_stdout + .and not_to_output.to_stderr + .and be_a_success end # TODO: add a test for the shell fast-path (`brew_sh`)