Browse Source

Added test to check the creation of the walker is

John Episcopo 6 years ago
parent
commit
434fa14f3d
1 changed files with 18 additions and 0 deletions
  1. 18 0
      walker_test.go

+ 18 - 0
walker_test.go

@@ -9,6 +9,24 @@ import (
 	"github.com/stretchr/testify/assert"
 )
 
+func TestWalkReturnsCorrectlyPopulatedWalker(t *testing.T) {
+	mock, err := newFtpMock(t, "127.0.0.1")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer mock.Close()
+
+	c, cErr := Connect(mock.Addr())
+	if cErr != nil {
+		t.Fatal(err)
+	}
+
+	w := c.Walk("root")
+
+	assert.Equal(t, "root/", w.root)
+	assert.Equal(t, &c, &w.serverConn)
+}
+
 func TestFieldsReturnCorrectData(t *testing.T) {
 	w := Walker{
 		cur: item{