cli/commands/auth/auth_test.go

23 lines
451 B
Go

package auth
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
"gitlab.com/gitlab-org/cli/commands/cmdutils"
"gitlab.com/gitlab-org/cli/test"
)
func TestIssueCmd(t *testing.T) {
old := os.Stdout // keep backup of the real stdout
r, w, _ := os.Pipe()
os.Stdout = w
assert.Nil(t, NewCmdAuth(&cmdutils.Factory{}).Execute())
out := test.ReturnBuffer(old, r, w)
assert.Contains(t, out, "Manage glab's authentication state\n")
}