vendor: add ginkgo and gomega

This commit is contained in:
Dan Williams
2018-06-13 15:38:30 -05:00
committed by Kuralamudhan Ramakrishnan
parent 1c8ad953d0
commit 5820658a5e
335 changed files with 29191 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
package gexec_test
import (
"bytes"
. "github.com/onsi/gomega/gexec"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("PrefixedWriter", func() {
var buffer *bytes.Buffer
var writer *PrefixedWriter
BeforeEach(func() {
buffer = &bytes.Buffer{}
writer = NewPrefixedWriter("[p]", buffer)
})
It("should emit the prefix on newlines", func() {
writer.Write([]byte("abc"))
writer.Write([]byte("def\n"))
writer.Write([]byte("hij\n"))
writer.Write([]byte("\n\n"))
writer.Write([]byte("klm\n\nnop"))
writer.Write([]byte(""))
writer.Write([]byte("qrs"))
writer.Write([]byte("\ntuv\nwx"))
writer.Write([]byte("yz\n\n"))
Ω(buffer.String()).Should(Equal(`[p]abcdef
[p]hij
[p]
[p]
[p]klm
[p]
[p]nopqrs
[p]tuv
[p]wxyz
[p]
`))
})
})