helpers: Remove ToReader funcs

Remove StringToReader and BytesToReader in favor of using the stdlib directly.
This commit is contained in:
Cameron Moore
2016-05-07 16:34:53 -05:00
parent 29ca323a34
commit e2aea65170
6 changed files with 18 additions and 38 deletions

View File

@@ -14,9 +14,10 @@
package source
import (
"github.com/spf13/hugo/helpers"
"github.com/stretchr/testify/assert"
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestFileUniqueID(t *testing.T) {
@@ -28,11 +29,11 @@ func TestFileUniqueID(t *testing.T) {
}
func TestFileString(t *testing.T) {
assert.Equal(t, "abc", NewFileWithContents("a", helpers.StringToReader("abc")).String())
assert.Equal(t, "abc", NewFileWithContents("a", strings.NewReader("abc")).String())
assert.Equal(t, "", NewFile("a").String())
}
func TestFileBytes(t *testing.T) {
assert.Equal(t, []byte("abc"), NewFileWithContents("a", helpers.StringToReader("abc")).Bytes())
assert.Equal(t, []byte("abc"), NewFileWithContents("a", strings.NewReader("abc")).Bytes())
assert.Equal(t, []byte(""), NewFile("a").Bytes())
}