Skip to content

Commit

Permalink
Fix TestInitializeCannotStatPathFileNameTooLong
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Murdaca <[email protected]>
  • Loading branch information
Antonio Murdaca committed Apr 15, 2015
1 parent 5b048ab commit 7afb234
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions volumes/volume_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package volumes

import (
"strings"
"os"
"testing"

"github.com/docker/docker/pkg/stringutils"
Expand Down Expand Up @@ -33,8 +33,8 @@ func TestInitializeCannotMkdirOnNonExistentPath(t *testing.T) {
t.Fatal("Expected not to initialize volume with a non existent path")
}

if !strings.Contains(err.Error(), "mkdir : no such file or directory") {
t.Fatalf("Expected to get mkdir no such file or directory, got %s", err)
if !os.IsNotExist(err) {
t.Fatalf("Expected to get ErrNotExist error, got %s", err)
}
}

Expand All @@ -49,7 +49,7 @@ func TestInitializeCannotStatPathFileNameTooLong(t *testing.T) {
t.Fatal("Expected not to initialize volume with a non existent path")
}

if !strings.Contains(err.Error(), "file name too long") {
t.Fatalf("Expected to get ENAMETOOLONG error, got %s", err)
if os.IsNotExist(err) {
t.Fatal("Expected to not get ErrNotExist")
}
}

0 comments on commit 7afb234

Please sign in to comment.