(t *testing.T, when spec.G, it spec.S)
| 17 | } |
| 18 | |
| 19 | func 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) |
| 36 | Stacks 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 | |
| 38 | Usage: |
| 39 | stack [command] |
| 40 | |
| 41 | Available 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 | |
| 46 | Flags: |
| 47 | -h, --help help for stack |
| 48 | |
| 49 | Use "stack [command] --help" for more information about a command. |
| 50 | `) |
| 51 | }) |
| 52 | }) |
| 53 | } |
nothing calls this directly
no test coverage detected