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

Function TestCommand_link_noArgs

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

Source from the content-addressed store, hash-verified

23}
24
25func TestCommand_link_noArgs(t *testing.T) {
26 StubCommandLineArgs("link")
27
28 appDir, _ := homedir.Expand("~/my-test-puma-dev-application")
29 defer MakeDirectoryOrFail(t, appDir)()
30
31 WithWorkingDirectory(appDir, func() {
32 actual := WithStdoutCaptured(func() {
33 if err := command(); err != nil {
34 assert.Fail(t, err.Error())
35 }
36 })
37
38 expected := fmt.Sprintf("+ App 'my-test-puma-dev-application' created, linked to '%s'\n", appDir)
39 assert.Equal(t, expected, actual)
40 })
41
42 RemoveAppSymlinkOrFail(t, "my-test-puma-dev-application")
43}
44
45func TestCommand_link_withNameOverride(t *testing.T) {
46 tmpCwd := "/tmp/puma-dev-example-command-link-noargs"

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected