aboutsummaryrefslogtreecommitdiffhomepage
path: root/helpers/path_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2016-09-18 19:52:42 +0200
committerBjørn Erik Pedersen <[email protected]>2016-09-18 19:52:42 +0200
commit98c12b7b3de0822d39886a4de5f3b18b295e3c3d (patch)
tree0203924bc72cb6c5e79fd7cc0fb9906d87cdea18 /helpers/path_test.go
parent4a79fa0c33f364cd753c022e0f741403985699b2 (diff)
downloadhugo-98c12b7b3de0822d39886a4de5f3b18b295e3c3d.tar.gz
hugo-98c12b7b3de0822d39886a4de5f3b18b295e3c3d.zip
Fail early in TestGetRealPath
See #2476
Diffstat (limited to 'helpers/path_test.go')
-rw-r--r--helpers/path_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/helpers/path_test.go b/helpers/path_test.go
index bd8f8ed49..9ce61b269 100644
--- a/helpers/path_test.go
+++ b/helpers/path_test.go
@@ -25,6 +25,8 @@ import (
"testing"
"time"
+ "github.com/stretchr/testify/require"
+
"github.com/stretchr/testify/assert"
"github.com/spf13/afero"
@@ -149,16 +151,16 @@ func TestGetRealPath(t *testing.T) {
fs := afero.NewOsFs()
rp1, err := GetRealPath(fs, d1)
- assert.NoError(t, err)
+ require.NoError(t, err)
assert.Equal(t, d1, rp1)
sym := filepath.Join(os.TempDir(), "d1sym")
err = os.Symlink(d1, sym)
+ require.NoError(t, err)
defer os.Remove(sym)
- assert.NoError(t, err)
rp2, err := GetRealPath(fs, sym)
- assert.NoError(t, err)
+ require.NoError(t, err)
// On OS X, the temp folder is itself a symbolic link (to /private...)
// This has to do for now.