(t *testing.T)
| 2599 | } |
| 2600 | |
| 2601 | func TestCommand_Run_SubcommandFullPath(t *testing.T) { |
| 2602 | out := &bytes.Buffer{} |
| 2603 | |
| 2604 | subCmd := &Command{ |
| 2605 | Name: "bar", |
| 2606 | Usage: "does bar things", |
| 2607 | ArgsUsage: "[arguments...]", |
| 2608 | } |
| 2609 | |
| 2610 | cmd := &Command{ |
| 2611 | Name: "foo", |
| 2612 | Description: "foo commands", |
| 2613 | Commands: []*Command{subCmd}, |
| 2614 | Writer: out, |
| 2615 | } |
| 2616 | |
| 2617 | require.NoError(t, cmd.Run(buildTestContext(t), []string{"foo", "bar", "--help"})) |
| 2618 | |
| 2619 | outString := out.String() |
| 2620 | require.Contains(t, outString, "foo bar - does bar things") |
| 2621 | require.Contains(t, outString, "foo bar [options] [arguments...]") |
| 2622 | } |
| 2623 | |
| 2624 | func TestCommand_Run_Help(t *testing.T) { |
| 2625 | tests := []struct { |
nothing calls this directly
no test coverage detected