github.com/zaquestion/lab@v0.25.1/cmd/project_browse_test.go (about) 1 package cmd 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/require" 7 ) 8 9 func Test_projectBrowse(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", url) 15 return nil 16 } 17 18 projectBrowseCmd.Run(nil, []string{""}) 19 }