TestRunUpdateCommand_SelfUpdateDisabled verifies that the update command returns an error when TNR_NO_SELFUPDATE environment variable is set.
(t *testing.T)
| 13 | // TestRunUpdateCommand_SelfUpdateDisabled verifies that the update command |
| 14 | // returns an error when TNR_NO_SELFUPDATE environment variable is set. |
| 15 | func TestRunUpdateCommand_SelfUpdateDisabled(t *testing.T) { |
| 16 | originalEnv := os.Getenv("TNR_NO_SELFUPDATE") |
| 17 | defer os.Setenv("TNR_NO_SELFUPDATE", originalEnv) |
| 18 | |
| 19 | os.Setenv("TNR_NO_SELFUPDATE", "1") |
| 20 | |
| 21 | err := runUpdateCommand() |
| 22 | assert.Error(t, err) |
| 23 | assert.Contains(t, err.Error(), "self-update is disabled") |
| 24 | assert.Contains(t, err.Error(), "TNR_NO_SELFUPDATE=1") |
| 25 | } |
| 26 | |
| 27 | // TestHandlePMUpdate_Homebrew verifies that handlePMUpdate prints correct |
| 28 | // instructions for Homebrew-managed installations. |
nothing calls this directly
no test coverage detected