github.com/ianfoo/lab@v0.9.5-0.20180123060006-5ed79f2ccfc7/cmd/clone_test.go (about)

     1  package cmd
     2  
     3  import (
     4  	"os/exec"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/assert"
     8  )
     9  
    10  func Test_clone(t *testing.T) {
    11  	t.Parallel()
    12  	repo := copyTestRepo(t)
    13  	cmd := exec.Command("../lab_bin", "clone", "test")
    14  	cmd.Dir = repo
    15  
    16  	b, err := cmd.CombinedOutput()
    17  	if err != nil {
    18  		t.Log(string(b))
    19  		t.Fatal(err)
    20  	}
    21  	out := string(b)
    22  	t.Log(out)
    23  
    24  	assert.Contains(t, out, "Cloning into 'test'...")
    25  	assert.Contains(t, out, " * [new branch]      master       -> upstream/master")
    26  	assert.Contains(t, out, "new remote: upstream")
    27  }