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

     1  package cmd
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/require"
     7  )
     8  
     9  func Test_mrBrowse(t *testing.T) {
    10  	oldBrowse := browse
    11  	defer func() { browse = oldBrowse }()
    12  
    13  	browse = func(url string) error {
    14  		require.Equal(t, "https://gitlab.com/zaquestion/test/merge_requests/1", url)
    15  		return nil
    16  	}
    17  
    18  	mrBrowseCmd.Run(nil, []string{"1"})
    19  }