Skip to content

Commit

Permalink
Partial solution for cask processing.
Browse files Browse the repository at this point in the history
'brew list --cask' seems to work, but both 'brew list --cask --version'
and 'brew list --version' fail because of empty cask list.
  • Loading branch information
ascherer committed Dec 25, 2024
1 parent e8b300a commit 9f09d39
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Library/Homebrew/test/cmd/list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
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
Expand All @@ -38,8 +38,11 @@
# .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
# .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
Expand Down

0 comments on commit 9f09d39

Please sign in to comment.