github.com/joey-fossa/fossa-cli@v0.7.34-0.20190708193710-569f1e8679f0/cmd/fossa/main_test.go (about) 1 package main_test 2 3 import ( 4 "strings" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 9 main "github.com/fossas/fossa-cli/cmd/fossa" 10 "github.com/fossas/fossa-cli/cmd/fossa/flags" 11 ) 12 13 func TestMainProvidesDebugFlag(t *testing.T) { 14 assert.Contains(t, main.App.VisibleFlags(), flags.DebugF) 15 } 16 17 func TestNoDuplicateFlags(t *testing.T) { 18 defer func() { 19 if r := recover(); r != nil { 20 if strings.HasPrefix(r.(string), "upload flag redefined") { 21 assert.Fail(t, "duplicate flag detected", r) 22 } else { 23 panic(r) 24 } 25 } 26 }() 27 _ = main.App.Run([]string{"fossa", "upload"}) 28 }