summaryrefslogtreecommitdiffstats
path: root/helpers/path_test.go
diff options
context:
space:
mode:
authorspf13 <steve.francia@gmail.com>2014-11-04 20:28:07 -0500
committerspf13 <steve.francia@gmail.com>2014-11-04 20:28:07 -0500
commit55fb02428dc22f5c40b4bdcba49032e63983cc0e (patch)
tree2487cb7da1098436578e4ab545fed2a500c8611e /helpers/path_test.go
parenta40bd3caf16ecabc189dd6e676792555d175540b (diff)
Updating tests to use hugofs
Diffstat (limited to 'helpers/path_test.go')
-rw-r--r--helpers/path_test.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/helpers/path_test.go b/helpers/path_test.go
index bab1786e2..c7ced1d79 100644
--- a/helpers/path_test.go
+++ b/helpers/path_test.go
@@ -8,6 +8,8 @@ import (
"strings"
"testing"
"time"
+
+ "github.com/spf13/afero"
)
func TestMakePath(t *testing.T) {
@@ -123,7 +125,7 @@ func TestDirExists(t *testing.T) {
}
for i, d := range data {
- exists, _ := DirExists(d.input)
+ exists, _ := DirExists(d.input, new(afero.OsFs))
if d.expected != exists {
t.Errorf("Test %d failed. Expected %t got %t", i, d.expected, exists)
}
@@ -143,7 +145,8 @@ func TestIsDir(t *testing.T) {
}
for i, d := range data {
- exists, _ := IsDir(d.input)
+
+ exists, _ := IsDir(d.input, new(afero.OsFs))
if d.expected != exists {
t.Errorf("Test %d failed. Expected %t got %t", i, d.expected, exists)
}
@@ -183,7 +186,7 @@ func TestIsEmpty(t *testing.T) {
{nonExistentDir, false, dirDoesNotExist},
}
for i, d := range data {
- exists, err := IsEmpty(d.input)
+ exists, err := IsEmpty(d.input, new(afero.OsFs))
if d.expectedResult != exists {
t.Errorf("Test %d failed. Expected result %t got %t", i, d.expectedResult, exists)
}
@@ -319,7 +322,7 @@ func TestExists(t *testing.T) {
{nonExistentDir, false, nil},
}
for i, d := range data {
- exists, err := Exists(d.input)
+ exists, err := Exists(d.input, new(afero.OsFs))
if d.expectedResult != exists {
t.Errorf("Test %d failed. Expected result %t got %t", i, d.expectedResult, exists)
}
@@ -500,7 +503,7 @@ func TestSafeWriteToDisk(t *testing.T) {
}
for i, d := range data {
- e := SafeWriteToDisk(d.filename, reader)
+ e := SafeWriteToDisk(d.filename, reader, new(afero.OsFs))
if d.expectedErr != nil {
if d.expectedErr.Error() != e.Error() {
t.Errorf("Test %d failed. Expected error %q but got %q", i, d.expectedErr.Error(), e.Error())
@@ -540,7 +543,7 @@ func TestWriteToDisk(t *testing.T) {
}
for i, d := range data {
- e := WriteToDisk(d.filename, reader)
+ e := WriteToDisk(d.filename, reader, new(afero.OsFs))
if d.expectedErr != e {
t.Errorf("Test %d failed. WriteToDisk Error Expected %q but got %q", i, d.expectedErr, e)
}