MCPcopy
hub / github.com/puma/puma-dev / TestUninstall_DarwinInteractive

Function TestUninstall_DarwinInteractive

dev/setup_darwin_test.go:29–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func TestUninstall_DarwinInteractive(t *testing.T) {
30 if m := flag.Lookup("test.run").Value.String(); m == "" || !regexp.MustCompile(m).MatchString(t.Name()) {
31 t.Skip("interactive test must be specified with -test.run=DarwinInteractive")
32 }
33 launchAgentDir, _, cleanupFunc := installIntoTestContext(t)
34 defer cleanupFunc()
35
36 assert.NoError(t, exec.Command("launchctl", "list", "io.puma.dev").Run())
37
38 Uninstall(launchAgentDir, []string{"test", "localhost"})
39
40 assert.Error(t, exec.Command("launchctl", "list", "io.puma.dev").Run())
41}
42
43func TestInstallIntoSystem_FailsAsSuperuser(t *testing.T) {
44 os.Setenv("SUDO_USER", os.Getenv("USER"))

Callers

nothing calls this directly

Calls 2

installIntoTestContextFunction · 0.85
UninstallFunction · 0.85

Tested by

no test coverage detected