github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/util/testhelpers/io/io_test.go (about)

     1  package io_test
     2  
     3  import (
     4  	"os"
     5  	"strings"
     6  
     7  	. "code.cloudfoundry.org/cli/util/testhelpers/io"
     8  	. "github.com/onsi/ginkgo"
     9  	. "github.com/onsi/gomega"
    10  )
    11  
    12  var _ = Describe("io helpers", func() {
    13  	It("will never overflow the pipe", func() {
    14  		str := strings.Repeat("z", 75000)
    15  		output := CaptureOutput(func() {
    16  			os.Stdout.Write([]byte(str))
    17  		})
    18  
    19  		Expect(output).To(Equal([]string{str}))
    20  	})
    21  })