1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
package stack
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
"gitlab.com/gitlab-org/cli/commands/cmdutils"
"gitlab.com/gitlab-org/cli/pkg/text"
"gitlab.com/gitlab-org/cli/test"
)
func TestStackCmd(t *testing.T) {
old := os.Stdout // keep backup of the real stdout
r, w, _ := os.Pipe()
os.Stdout = w
assert.Nil(t, NewCmdStack(&cmdutils.Factory{}).Execute())
out := test.ReturnBuffer(old, r, w)
assert.Contains(t, out, "Stacked diffs are a way of creating small changes that build upon each other to ultimately deliver")
assert.Contains(t, out, text.ExperimentalString)
}
|