Clarify paste tests

master
Nick Krichevsky 2019-03-17 17:43:24 -04:00
parent 65765a3da2
commit bd1392b22b
1 changed files with 2 additions and 1 deletions

View File

@ -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++