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

Function TestCommandEnvDoesNotEval

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

Source from the content-addressed store, hash-verified

188}
189
190func TestCommandEnvDoesNotEval(t *testing.T) {
191 ctx := context.Background()
192 stdout, _, err := NewBuilder(ctx, "echo", "-n", "$foo").
193 WithEnv(Env{"foo": "bar"}).
194 Prepare().
195 RunAndGetOutput()
196
197 assert.NoError(t, err)
198 // Not expanded
199 assert.Equal(t, []byte("$foo"), stdout)
200}
201
202func TestCommandContextCancels(t *testing.T) {
203 ctx, cancel := context.WithCancel(context.Background())

Callers

nothing calls this directly

Calls 4

NewBuilderFunction · 0.85
RunAndGetOutputMethod · 0.65
PrepareMethod · 0.65
WithEnvMethod · 0.65

Tested by

no test coverage detected