TestCmd_git tests that if a package path contains .git, it is still parsed correctly
(t *testing.T)
| 167 | |
| 168 | // TestCmd_git tests that if a package path contains .git, it is still parsed correctly |
| 169 | func TestCmd_git(t *testing.T) { |
| 170 | r := cmdget.NewRunner("kpt") |
| 171 | r.Command.SetArgs([]string{"https://github.com/GoogleContainerTools/kpt/.github/workflows", "./"}) |
| 172 | err := r.Command.Execute() |
| 173 | assert.NoError(t, err) |
| 174 | assert.NoError(t, os.RemoveAll("workflows")) |
| 175 | } |
| 176 | |
| 177 | // NoOpRunE is a noop function to replace the run function of a command. Useful for testing argument parsing. |
| 178 | var NoOpRunE = func(cmd *cobra.Command, args []string) error { return nil } |