github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/util/testhelpers/io/io_test.go (about)

     1  package io_test
     2  
     3  import (
     4  	"os"
     5  	"strings"
     6  
     7  	. "code.cloudfoundry.org/cli/cf/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  })