func NewStringFile(data, fileName string) *ReadWriteFile {
	buffer := &bytes.Buffer{}
	file := &ReadWriteFile{
		File:          File{},
		Reader:        strings.NewReader(data),
		Writer:        buffer,
		Buffer:        buffer,
		ReaderContent: data,
	}
	file.On("Read", mock.Anything).Return(len(data), nil)
	file.On("Write", mock.Anything).Return(len(data), nil)
	file.On("Close").Return(nil)
	file.On("Name").Return(fileName)
	return file
}
NewStringFile creates a new ReadWriteFile instance that can be read from the provided string as it's contents.
package mocks
import (
	"bytes"
	"io"
	"io/ioutil"
	"path/filepath"
	"strings"
	"github.com/stretchr/testify/mock"
)