| 59 | } |
| 60 | |
| 61 | func TestCreateErrorOnContextDirWithoutConfig(t *testing.T) { |
| 62 | tmpDir := fs.NewDir(t, "plugin-create-test") |
| 63 | defer tmpDir.Remove() |
| 64 | |
| 65 | cli := test.NewFakeCli(&fakeClient{}) |
| 66 | cmd := newCreateCommand(cli) |
| 67 | cmd.SetArgs([]string{"plugin-foo", tmpDir.Path()}) |
| 68 | cmd.SetOut(io.Discard) |
| 69 | cmd.SetErr(io.Discard) |
| 70 | |
| 71 | expectedErr := "config.json: no such file or directory" |
| 72 | if runtime.GOOS == "windows" { |
| 73 | expectedErr = "config.json: The system cannot find the file specified." |
| 74 | } |
| 75 | assert.ErrorContains(t, cmd.Execute(), expectedErr) |
| 76 | } |
| 77 | |
| 78 | func TestCreateErrorOnInvalidConfig(t *testing.T) { |
| 79 | tmpDir := fs.NewDir(t, "plugin-create-test", |