test(cli): add failing pretend quiet dry-run coverage

This commit is contained in:
Micheal Wilkinson
2026-03-20 18:08:37 +00:00
parent 5307e4d35f
commit 7f8a5d24e3
2 changed files with 47 additions and 0 deletions

View File

@@ -77,3 +77,13 @@ func (s *ExecSuite) TestExecAll_RunsCommandForEachCastle() {
require.NoError(s.T(), s.app.ExecAll([]string{"basename \"$PWD\""}))
require.Equal(s.T(), "alpha\nzeta\n", s.stdout.String())
}
func (s *ExecSuite) TestExec_PretendDoesNotExecuteCommand() {
castleRoot := s.createCastle("dotfiles")
target := filepath.Join(castleRoot, "should-not-exist")
s.app.Pretend = true
require.NoError(s.T(), s.app.Exec("dotfiles", []string{"touch should-not-exist"}))
require.NoFileExists(s.T(), target)
require.Contains(s.T(), s.stdout.String(), "Would execute")
}