mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
22 lines
449 B
Go
22 lines
449 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/kami-zh/go-capturer"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func Test_MainHelp(t *testing.T) {
|
|
os.Args = []string{"", "--help"}
|
|
exitFn = func(code int) { require.Equal(t, 0, code) }
|
|
|
|
output := capturer.CaptureStdout(main)
|
|
|
|
assert.Contains(t, output, "USAGE:")
|
|
assert.Contains(t, output, "COMMANDS:")
|
|
assert.Contains(t, output, "GLOBAL OPTIONS:")
|
|
}
|