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

Function TestCommand_link_withNameOverride

cmd/puma-dev/command_test.go:45–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func TestCommand_link_withNameOverride(t *testing.T) {
46 tmpCwd := "/tmp/puma-dev-example-command-link-noargs"
47 defer MakeDirectoryOrFail(t, tmpCwd)()
48
49 StubCommandLineArgs("link", "-n", "anothername", tmpCwd)
50
51 WithWorkingDirectory(tmpCwd, func() {
52 actual := WithStdoutCaptured(func() {
53 if err := command(); err != nil {
54 assert.Fail(t, err.Error())
55 }
56 })
57
58 assert.Equal(t, "+ App 'anothername' created, linked to '/tmp/puma-dev-example-command-link-noargs'\n", actual)
59 })
60
61 RemoveAppSymlinkOrFail(t, "anothername")
62}
63
64func TestCommand_link_invalidDirectory(t *testing.T) {
65 StubCommandLineArgs("link", "/this/path/does/not/exist")

Callers

nothing calls this directly

Calls 6

MakeDirectoryOrFailFunction · 0.85
StubCommandLineArgsFunction · 0.85
WithWorkingDirectoryFunction · 0.85
WithStdoutCapturedFunction · 0.85
commandFunction · 0.85
RemoveAppSymlinkOrFailFunction · 0.85

Tested by

no test coverage detected