(t *testing.T)
| 129 | } |
| 130 | |
| 131 | func TestProjectNewCommandArgs(t *testing.T) { |
| 132 | cmd := NewProjectNewCommand() |
| 133 | |
| 134 | tests := []struct { |
| 135 | name string |
| 136 | args []string |
| 137 | shouldErr bool |
| 138 | }{ |
| 139 | { |
| 140 | name: "no arguments", |
| 141 | args: []string{}, |
| 142 | shouldErr: true, |
| 143 | }, |
| 144 | { |
| 145 | name: "one argument", |
| 146 | args: []string{"My Project"}, |
| 147 | shouldErr: false, |
| 148 | }, |
| 149 | { |
| 150 | name: "too many arguments", |
| 151 | args: []string{"My Project", "Extra"}, |
| 152 | shouldErr: true, |
| 153 | }, |
| 154 | } |
| 155 | |
| 156 | for _, tt := range tests { |
| 157 | t.Run(tt.name, func(t *testing.T) { |
| 158 | err := cmd.Args(cmd, tt.args) |
| 159 | if tt.shouldErr { |
| 160 | assert.Error(t, err, "Should return error for invalid arguments") |
| 161 | } else { |
| 162 | assert.NoError(t, err, "Should not return error for valid arguments") |
| 163 | } |
| 164 | }) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | func TestProjectNewCommandFlags(t *testing.T) { |
| 169 | cmd := NewProjectNewCommand() |
nothing calls this directly
no test coverage detected