MCPcopy Create free account
hub / github.com/Shopify/goose / TestCommandWithWorkingDir

Function TestCommandWithWorkingDir

shell/shell_test.go:178–188  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

176}
177
178func TestCommandWithWorkingDir(t *testing.T) {
179 tempDir := t.TempDir()
180 ctx := context.Background()
181 stdout, _, err := NewBuilder(ctx, "pwd").
182 WithWorkingDir(tempDir).
183 Prepare().
184 RunAndGetOutput()
185
186 require.NoError(t, err)
187 assert.Equal(t, []byte(tempDir+"\n"), stdout)
188}
189
190func TestCommandEnvDoesNotEval(t *testing.T) {
191 ctx := context.Background()

Callers

nothing calls this directly

Calls 4

NewBuilderFunction · 0.85
RunAndGetOutputMethod · 0.65
PrepareMethod · 0.65
WithWorkingDirMethod · 0.65

Tested by

no test coverage detected