Clarify paste tests
parent
65765a3da2
commit
bd1392b22b
|
@ -121,7 +121,7 @@ func TestPipe(t *testing.T) {
|
|||
pasteContents := []string{"hello", " pipe", ""}
|
||||
errors := []error{nil, nil, io.EOF}
|
||||
|
||||
readCall := mockFile.On("Read", mock.Anything).Return(len(pasteContents[0]), nil)
|
||||
readCall := mockFile.On("Read", mock.Anything)
|
||||
readCall.Run(func(args mock.Arguments) {
|
||||
buffer := args.Get(0).([]byte)
|
||||
singlePasteContents := pasteContents[readCursor]
|
||||
|
@ -129,6 +129,7 @@ func TestPipe(t *testing.T) {
|
|||
for i, char := range singlePasteContents {
|
||||
buffer[i] = byte(char)
|
||||
}
|
||||
// Return the the values corresponding to readCursor
|
||||
readCall.Return(len(singlePasteContents), errors[readCursor])
|
||||
|
||||
readCursor++
|
||||
|
|
Loading…
Reference in New Issue