github.com/elopio/cli@v6.21.2-0.20160902224010-ea909d1fdb2f+incompatible/utils/generic/slice_test.go (about) 1 package generic_test 2 3 import ( 4 "code.cloudfoundry.org/cli/utils/generic" 5 . "github.com/onsi/ginkgo" 6 . "github.com/onsi/gomega" 7 ) 8 9 func init() { 10 Describe("IsSliceable", func() { 11 It("should return false when the type cannot be sliced", func() { 12 Expect(generic.IsSliceable("bad slicing")).To(BeFalse()) 13 }) 14 15 It("should return true if the type can be sliced", func() { 16 Expect(generic.IsSliceable([]string{"a string"})).To(BeTrue()) 17 }) 18 19 It("should return true if the type can be sliced", func() { 20 Expect(generic.IsSliceable([]interface{}{1, 2, 3})).To(BeTrue()) 21 }) 22 }) 23 }