github.com/rakutentech/cli@v6.12.5-0.20151006231303-24468b65536e+incompatible/testhelpers/io/io_test.go (about)

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