test(pull): add failing pull --all parity coverage
This commit is contained in:
@@ -79,6 +79,13 @@ func (s *CLISuite) TestRun_Exec_RunsCommandInCastleRoot() {
|
||||
require.Empty(s.T(), s.stderr.String())
|
||||
}
|
||||
|
||||
func (s *CLISuite) TestRun_PullAll_NoCastlesIsNoop() {
|
||||
exitCode := cli.Run([]string{"pull", "--all"}, s.stdout, s.stderr)
|
||||
|
||||
require.Equal(s.T(), 0, exitCode)
|
||||
require.Empty(s.T(), s.stderr.String())
|
||||
}
|
||||
|
||||
func (s *CLISuite) TestRun_CloneSubcommandHelp() {
|
||||
exitCode := cli.Run([]string{"clone", "--help"}, s.stdout, s.stderr)
|
||||
|
||||
|
||||
@@ -112,3 +112,18 @@ func (s *PullSuite) TestPull_MissingCastleReturnsError() {
|
||||
err := s.app.Pull("missing")
|
||||
require.Error(s.T(), err)
|
||||
}
|
||||
|
||||
func (s *PullSuite) TestPullAll_UpdatesAllCastlesFromOrigin() {
|
||||
remoteA, cloneA := s.createRemoteWithClone("alpha")
|
||||
remoteB, cloneB := s.createRemoteWithClone("zeta")
|
||||
s.addRemoteCommit(remoteA, "alpha")
|
||||
s.addRemoteCommit(remoteB, "zeta")
|
||||
|
||||
require.NoError(s.T(), s.app.PullAll())
|
||||
require.FileExists(s.T(), filepath.Join(cloneA, "home", ".zshrc"))
|
||||
require.FileExists(s.T(), filepath.Join(cloneB, "home", ".zshrc"))
|
||||
}
|
||||
|
||||
func (s *PullSuite) TestPullAll_NoCastlesIsNoop() {
|
||||
require.NoError(s.T(), s.app.PullAll())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user