github.com/tomsquest/goreleaser@v0.34.3-0.20171008022654-7d6ef4d338b3/internal/git/git_test.go (about)

     1  package git
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestGit(t *testing.T) {
    10  	out, err := Run("status")
    11  	assert.NoError(t, err)
    12  	assert.NotEmpty(t, out)
    13  
    14  	out, err = Run("command-that-dont-exist")
    15  	assert.Error(t, err)
    16  	assert.Empty(t, out)
    17  	assert.Equal(
    18  		t,
    19  		"git: 'command-that-dont-exist' is not a git command. See 'git --help'.\n",
    20  		err.Error(),
    21  	)
    22  }