Skip to content

Commit 7468876

Browse files
committed
Add test for #386
Signed-off-by: David Gageot <[email protected]>
1 parent c6b1701 commit 7468876

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/skaffold/docker/context_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ func TestDockerContext(t *testing.T) {
3434
os.Mkdir(filepath.Join(tmpDir, "files"), 0750)
3535
ioutil.WriteFile(filepath.Join(tmpDir, "files", "ignored.txt"), []byte(""), 0644)
3636
ioutil.WriteFile(filepath.Join(tmpDir, "files", "included.txt"), []byte(""), 0644)
37-
ioutil.WriteFile(filepath.Join(tmpDir, ".dockerignore"), []byte("**/ignored.txt"), 0644)
37+
ioutil.WriteFile(filepath.Join(tmpDir, ".dockerignore"), []byte("**/ignored.txt\nalsoignored.txt"), 0644)
3838
ioutil.WriteFile(filepath.Join(tmpDir, "Dockerfile"), []byte("FROM alpine\nCOPY ./files /files"), 0644)
3939
ioutil.WriteFile(filepath.Join(tmpDir, "ignored.txt"), []byte(""), 0644)
40+
ioutil.WriteFile(filepath.Join(tmpDir, "alsoignored.txt"), []byte(""), 0644)
4041

4142
reader, writer := io.Pipe()
4243
go func() {
@@ -65,6 +66,9 @@ func TestDockerContext(t *testing.T) {
6566
if files["ignored.txt"] {
6667
t.Error("File ignored.txt should have been excluded, but was not")
6768
}
69+
if files["alsoignored.txt"] {
70+
t.Error("File alsoignored.txt should have been excluded, but was not")
71+
}
6872
if files["files/ignored.txt"] {
6973
t.Error("File files/ignored.txt should have been excluded, but was not")
7074
}

0 commit comments

Comments
 (0)