(t *testing.T)
| 216 | } |
| 217 | |
| 218 | func TestRunEncrypt_Interactive_Success(t *testing.T) { |
| 219 | defer resetMocks() |
| 220 | setupTempConfig(t, configWithPasswordsYAML) |
| 221 | |
| 222 | callCount := 0 |
| 223 | readPasswordFn = func(_ string) ([]byte, error) { |
| 224 | callCount++ |
| 225 | return []byte("testpassword123"), nil |
| 226 | } |
| 227 | |
| 228 | runEncrypt() |
| 229 | |
| 230 | configPath := config.DefaultConfigPath |
| 231 | data, err := os.ReadFile(configPath) |
| 232 | require.NoError(t, err) |
| 233 | content := string(data) |
| 234 | assert.Contains(t, content, "enc:") |
| 235 | assert.NotContains(t, content, "secret1") |
| 236 | } |
| 237 | |
| 238 | // --- executeEncrypt error paths --- |
| 239 |
nothing calls this directly
no test coverage detected