error-pages/internal/cli/app_test.go

26 lines
423 B
Go
Raw Normal View History

2023-01-29 10:54:56 +00:00
package cli_test
import (
2024-06-21 13:13:27 +00:00
"context"
2023-01-29 10:54:56 +00:00
"testing"
2024-06-21 13:13:27 +00:00
"github.com/kami-zh/go-capturer"
2023-01-29 10:54:56 +00:00
"github.com/stretchr/testify/assert"
"gh.tarampamp.am/error-pages/internal/cli"
2023-01-29 10:54:56 +00:00
)
2024-06-21 13:13:27 +00:00
func TestNewApp(t *testing.T) {
2023-01-29 10:54:56 +00:00
t.Parallel()
2024-06-21 13:13:27 +00:00
app := cli.NewApp("appName")
2023-01-29 10:54:56 +00:00
assert.NotEmpty(t, app.Flags)
2024-06-21 13:13:27 +00:00
output := capturer.CaptureStdout(func() {
assert.NoError(t, app.Run(context.Background(), []string{""}))
})
assert.NotEmpty(t, output)
2023-01-29 10:54:56 +00:00
}