From 0ebbd118e4450ff3126277127e98148e69ad098f Mon Sep 17 00:00:00 2001 From: thibhero Date: Thu, 6 Mar 2025 21:27:35 -0500 Subject: [PATCH] test for reinstall --- Library/Homebrew/test/cmd/reinstall_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Library/Homebrew/test/cmd/reinstall_spec.rb b/Library/Homebrew/test/cmd/reinstall_spec.rb index fd5690de26..9452e9b1cb 100644 --- a/Library/Homebrew/test/cmd/reinstall_spec.rb +++ b/Library/Homebrew/test/cmd/reinstall_spec.rb @@ -20,4 +20,18 @@ RSpec.describe Homebrew::Cmd::Reinstall do expect(foo_dir).to exist end + + it "reinstalls a Formula with ask input", :integration_test do + install_test_formula "testball" + foo_dir = HOMEBREW_CELLAR/"testball/0.1/bin" + expect(foo_dir).to exist + FileUtils.rm_r(foo_dir) + + expect { brew "reinstall", "--ask", "testball" } + .to output(/.*Formula\s*\(1\):\s*testball.*/).to_stdout + .and not_to_output.to_stderr + .and be_a_success + + expect(foo_dir).to exist + end end