mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
Prevent test-docker and test-docker-online from running the same 36 offline integration tests. Each offline test file now has `//go:build !online` so the two sets are mutually exclusive: - default (no tag): 36 offline tests only - -tags online: online tests only
57 lines
1.2 KiB
Go
57 lines
1.2 KiB
Go
//go:build !online
|
|
|
|
package integration
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"skillshare/internal/testutil"
|
|
)
|
|
|
|
func TestHelp_ShowsUsage(t *testing.T) {
|
|
sb := testutil.NewSandbox(t)
|
|
defer sb.Cleanup()
|
|
|
|
result := sb.RunCLI("help")
|
|
result.AssertSuccess(t)
|
|
result.AssertOutputContains(t, "skillshare")
|
|
result.AssertOutputContains(t, "CORE COMMANDS")
|
|
result.AssertOutputContains(t, "UTILITIES")
|
|
}
|
|
|
|
func TestHelp_ShortFlag(t *testing.T) {
|
|
sb := testutil.NewSandbox(t)
|
|
defer sb.Cleanup()
|
|
|
|
result := sb.RunCLI("-h")
|
|
result.AssertSuccess(t)
|
|
result.AssertOutputContains(t, "CORE COMMANDS")
|
|
}
|
|
|
|
func TestHelp_LongFlag(t *testing.T) {
|
|
sb := testutil.NewSandbox(t)
|
|
defer sb.Cleanup()
|
|
|
|
result := sb.RunCLI("--help")
|
|
result.AssertSuccess(t)
|
|
result.AssertOutputContains(t, "CORE COMMANDS")
|
|
}
|
|
|
|
func TestNoArgs_ShowsUsage(t *testing.T) {
|
|
sb := testutil.NewSandbox(t)
|
|
defer sb.Cleanup()
|
|
|
|
result := sb.RunCLI()
|
|
result.AssertFailure(t)
|
|
result.AssertOutputContains(t, "CORE COMMANDS")
|
|
}
|
|
|
|
func TestUnknownCommand_ShowsError(t *testing.T) {
|
|
sb := testutil.NewSandbox(t)
|
|
defer sb.Cleanup()
|
|
|
|
result := sb.RunCLI("unknowncommand")
|
|
result.AssertFailure(t)
|
|
result.AssertAnyOutputContains(t, "Unknown command")
|
|
}
|