1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-11-26 21:25:18 +01:00
ntfy/cmd/app_test.go

27 lines
446 B
Go
Raw Normal View History

2021-12-20 00:32:16 +01:00
package cmd
import (
"bytes"
"github.com/urfave/cli/v2"
"io"
"log"
"os"
"testing"
)
// This only contains helpers so far
func TestMain(m *testing.M) {
log.SetOutput(io.Discard)
os.Exit(m.Run())
}
func newTestApp() (*cli.App, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer) {
var stdin, stdout, stderr bytes.Buffer
app := New()
app.Reader = &stdin
app.Writer = &stdout
app.ErrWriter = &stderr
return app, &stdin, &stdout, &stderr
}