cli/commands/incident/incident_test.go

23 lines
420 B
Go
Raw Normal View History

2022-11-14 17:37:10 +00:00
package incident
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
2022-11-14 17:37:10 +00:00
"gitlab.com/gitlab-org/cli/commands/cmdutils"
"gitlab.com/gitlab-org/cli/test"
2022-11-14 17:37:10 +00:00
)
func TestIncidentCmd(t *testing.T) {
old := os.Stdout
r, w, _ := os.Pipe()
os.Stdout = w
assert.Nil(t, NewCmdIncident(&cmdutils.Factory{}).Execute())
out := test.ReturnBuffer(old, r, w)
2022-11-14 17:37:10 +00:00
assert.Contains(t, out, "Work with GitLab incidents\n")
}