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