github.com/nkprince007/lab@v0.6.2-0.20171218071646-19d68b56f403/cmd/issueShow_test.go (about)

     1  package cmd
     2  
     3  import (
     4  	"os/exec"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/require"
     8  )
     9  
    10  func Test_issueShow(t *testing.T) {
    11  	repo := copyTestRepo(t)
    12  	cmd := exec.Command("../lab_bin", "issue", "1")
    13  	cmd.Dir = repo
    14  
    15  	b, err := cmd.CombinedOutput()
    16  	if err != nil {
    17  		t.Log(string(b))
    18  		t.Error(err)
    19  	}
    20  
    21  	require.Contains(t, string(b), `
    22  #1 test issue for lab list
    23  ===================================
    24  
    25  -----------------------------------
    26  Project: zaquestion/test
    27  Status: Open
    28  Assignee: zaquestion
    29  Author: lab-testing
    30  Milestone: None
    31  Due Date: None
    32  Time Stats: None
    33  Labels: bug
    34  WebURL: https://gitlab.com/zaquestion/test/issues/1
    35  `)
    36  }