summaryrefslogtreecommitdiff
path: root/internal/cmd/showcase_test.go
blob: d120d0609bc7a8e7f822e255598e00bd638c08fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package cmd

import (
	"strings"
	"testing"
)

func TestShowcaseCommand_FlagsMatchImplementedBehavior(t *testing.T) {
	t.Parallel()

	if showcaseCmd.Flags().Lookup("output") != nil {
		t.Fatal("showcase command should not expose unsupported --output flag")
	}
	if showcaseCmd.Flags().Lookup("format") != nil {
		t.Fatal("showcase command should not expose unsupported --format flag")
	}
	if showcaseCmd.Flags().Lookup("exclude") != nil {
		t.Fatal("showcase command should not expose unsupported --exclude flag")
	}

	if showcaseCmd.Flags().Lookup("force") == nil {
		t.Fatal("showcase command must expose --force")
	}
	if showcaseCmd.Flags().Lookup("ai-tool") == nil {
		t.Fatal("showcase command must expose --ai-tool")
	}
	if showcaseCmd.Flags().Lookup("repo") == nil {
		t.Fatal("showcase command must expose --repo")
	}
}

func TestShowcaseCommand_ExamplesDoNotMentionUnsupportedFlags(t *testing.T) {
	t.Parallel()

	example := showcaseCmd.Example
	if strings.Contains(example, "--output") {
		t.Fatal("showcase example should not mention unsupported --output")
	}
	if strings.Contains(example, "--format") {
		t.Fatal("showcase example should not mention unsupported --format")
	}
	if strings.Contains(example, "--exclude") {
		t.Fatal("showcase example should not mention unsupported --exclude")
	}
}