github.com/arunkumar7540/cli@v6.45.0+incompatible/util/randomword/generator_test.go (about) 1 package randomword_test 2 3 import ( 4 . "code.cloudfoundry.org/cli/util/randomword" 5 6 . "github.com/onsi/ginkgo" 7 . "github.com/onsi/gomega" 8 ) 9 10 var _ = Describe("Generator", func() { 11 var gen Generator 12 13 Describe("RandomAdjective", func() { 14 It("generates a random adjective each time it is called", func() { 15 Eventually(gen.RandomAdjective).ShouldNot(Equal(gen.RandomAdjective())) 16 }) 17 }) 18 19 Describe("RandomNoun", func() { 20 It("generates a random noun each time it is called", func() { 21 Eventually(gen.RandomNoun).ShouldNot(Equal(gen.RandomNoun())) 22 }) 23 }) 24 25 Describe("Babble", func() { 26 It("generates a random adjective noun pair each time it is called", func() { 27 wordPair := gen.Babble() 28 Expect(wordPair).To(MatchRegexp(`^\w+-\w+$`)) 29 }) 30 }) 31 })