(t *testing.T)
| 106 | } |
| 107 | |
| 108 | func TestRunRequiresUsername(t *testing.T) { |
| 109 | targetPath := filepath.Join(t.TempDir(), "config.yml") |
| 110 | |
| 111 | _, err := Run(Options{ |
| 112 | TargetPath: targetPath, |
| 113 | Prompts: &fakePrompts{ |
| 114 | lines: []string{" ", "", ""}, |
| 115 | password: "secret", |
| 116 | }, |
| 117 | }) |
| 118 | require.Error(t, err) |
| 119 | assert.Contains(t, err.Error(), "username is required") |
| 120 | assert.NoFileExists(t, targetPath) |
| 121 | } |
| 122 | |
| 123 | func TestRunRequiresPassword(t *testing.T) { |
| 124 | targetPath := filepath.Join(t.TempDir(), "config.yml") |