TestCmd_failExists verifies the command throws and error if the directory exists
(t *testing.T)
| 128 | |
| 129 | // TestCmd_failExists verifies the command throws and error if the directory exists |
| 130 | func TestCmd_failNotExists(t *testing.T) { |
| 131 | d, err := ioutil.TempDir("", "kpt") |
| 132 | assert.NoError(t, err) |
| 133 | |
| 134 | r := cmdinit.NewRunner("kpt") |
| 135 | r.Command.SetArgs([]string{filepath.Join(d, "my-pkg"), "--description", "my description", "--tag", "app.kpt.dev/cockroachdb"}) |
| 136 | err = r.Command.Execute() |
| 137 | if assert.Error(t, err) { |
| 138 | assert.Contains(t, err.Error(), "does not exist") |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | func TestGitUtil_DefaultRef(t *testing.T) { |
| 143 | // set up git repo with both main and master branches |