(t *testing.T)
| 47 | } |
| 48 | |
| 49 | func TestCreateErrorOnFileAsContextDir(t *testing.T) { |
| 50 | tmpFile := fs.NewFile(t, "file-as-context-dir") |
| 51 | defer tmpFile.Remove() |
| 52 | |
| 53 | cli := test.NewFakeCli(&fakeClient{}) |
| 54 | cmd := newCreateCommand(cli) |
| 55 | cmd.SetArgs([]string{"plugin-foo", tmpFile.Path()}) |
| 56 | cmd.SetOut(io.Discard) |
| 57 | cmd.SetErr(io.Discard) |
| 58 | assert.ErrorContains(t, cmd.Execute(), "context must be a directory") |
| 59 | } |
| 60 | |
| 61 | func TestCreateErrorOnContextDirWithoutConfig(t *testing.T) { |
| 62 | tmpDir := fs.NewDir(t, "plugin-create-test") |