Resolved through the public entry point, so a fixture is built the way a command builds one.
(t *testing.T, args ...string)
| 32 | // Resolved through the public entry point, so a fixture is built the way a |
| 33 | // command builds one. |
| 34 | func assetsFromArgs(t *testing.T, args ...string) ([]UserAsset, error) { |
| 35 | t.Helper() |
| 36 | |
| 37 | cmd := &cobra.Command{} |
| 38 | attachFlag := AddFlag(cmd) |
| 39 | |
| 40 | argv := make([]string, 0, len(args)*2) |
| 41 | for _, arg := range args { |
| 42 | argv = append(argv, "--attach", arg) |
| 43 | } |
| 44 | require.NoError(t, cmd.Flags().Parse(argv)) |
| 45 | |
| 46 | return attachFlag.UserAssets() |
| 47 | } |
| 48 | |
| 49 | func TestAddFlag(t *testing.T) { |
| 50 | t.Parallel() |
no test coverage detected