(t *testing.T)
| 130 | } |
| 131 | |
| 132 | func TestRunEncrypt_EnvVar_WithPasswords(t *testing.T) { |
| 133 | defer resetMocks() |
| 134 | setupTempConfig(t, configWithPasswordsYAML) |
| 135 | |
| 136 | os.Setenv("TRYSSH_MASTER_KEY", "testpassword123") |
| 137 | runEncrypt() |
| 138 | |
| 139 | configPath := config.DefaultConfigPath |
| 140 | data, err := os.ReadFile(configPath) |
| 141 | require.NoError(t, err) |
| 142 | content := string(data) |
| 143 | assert.Contains(t, content, "enc:") |
| 144 | assert.NotContains(t, content, "secret1") |
| 145 | } |
| 146 | |
| 147 | // --- runEncrypt interactive path (injected readPasswordFn) --- |
| 148 |
nothing calls this directly
no test coverage detected