MCPcopy Create free account
hub / github.com/buildpacks/pack / testStackCommand

Function testStackCommand

internal/commands/stack_test.go:19–53  ·  view source on GitHub ↗
(t *testing.T, when spec.G, it spec.S)

Source from the content-addressed store, hash-verified

17}
18
19func testStackCommand(t *testing.T, when spec.G, it spec.S) {
20 var (
21 command *cobra.Command
22 outBuf bytes.Buffer
23 )
24
25 it.Before(func() {
26 command = NewStackCommand(logging.NewLogWithWriters(&outBuf, &outBuf))
27 })
28
29 when("#Stack", func() {
30 it("displays stack information", func() {
31 command.SetArgs([]string{})
32 bb := bytes.NewBufferString("") // In most tests we don't seem to need to this, not sure why it's necessary here.
33 command.SetOut(bb)
34 h.AssertNil(t, command.Execute())
35 h.AssertEq(t, bb.String(), `(Deprecated)
36Stacks are deprecated in favor of using BuildImages and RunImages directly, but will continue to be supported throughout all of 2023 and '24 if not longer. Please see our docs for more details- https://buildpacks.io/docs/concepts/components/stack
37
38Usage:
39 stack [command]
40
41Available Commands:
42 completion Generate the autocompletion script for the specified shell
43 help Help about any command
44 suggest (deprecated) List the recommended stacks
45
46Flags:
47 -h, --help help for stack
48
49Use "stack [command] --help" for more information about a command.
50`)
51 })
52 })
53}

Callers

nothing calls this directly

Calls 4

NewLogWithWritersFunction · 0.92
NewStackCommandFunction · 0.85
ExecuteMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected