forked from mirror/afero
Removing use of testify
This commit is contained in:
parent
cb8b6bc2ff
commit
bf960e8dcb
1
go.mod
1
go.mod
|
@ -2,7 +2,6 @@ module github.com/spf13/afero
|
|||
|
||||
require (
|
||||
github.com/pkg/sftp v1.10.1
|
||||
github.com/stretchr/testify v1.4.0
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
|
||||
golang.org/x/text v0.3.3
|
||||
)
|
||||
|
|
|
@ -8,9 +8,6 @@ import (
|
|||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNormalizePath(t *testing.T) {
|
||||
|
@ -663,13 +660,21 @@ func TestMemFsLstatIfPossible(t *testing.T) {
|
|||
|
||||
// We assert that fs implements Lstater
|
||||
fsAsserted, ok := fs.(Lstater)
|
||||
require.True(t, ok, "The filesytem does not implement Lstater")
|
||||
if !ok {
|
||||
t.Fatalf("The filesytem does not implement Lstater")
|
||||
}
|
||||
|
||||
file, err := fs.OpenFile("/a.txt", os.O_CREATE, 0o644)
|
||||
require.NoError(t, err)
|
||||
if err != nil {
|
||||
t.Fatalf("Error when opening file: %v", err)
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
_, lstatCalled, err := fsAsserted.LstatIfPossible("/a.txt")
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, lstatCalled)
|
||||
if err != nil {
|
||||
t.Fatalf("Function returned err: %v", err)
|
||||
}
|
||||
if lstatCalled {
|
||||
t.Fatalf("Function indicated lstat was called. This should never be true.")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue