test(cli): add failing pretend quiet dry-run coverage
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user