mirror of
https://github.com/docker/compose.git
synced 2025-07-25 14:44:29 +02:00
dockerignore: improve MatchesEntireDir (#1865)
This commit is contained in:
parent
a31350ede1
commit
b22dde9f18
@ -509,6 +509,32 @@ func TestIgnoreCreatedDir(t *testing.T) {
|
|||||||
assert.Equal(t, expectedWatches, int(numberOfWatches.Value()))
|
assert.Equal(t, expectedWatches, int(numberOfWatches.Value()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestIgnoreCreatedDirWithExclusions(t *testing.T) {
|
||||||
|
f := newNotifyFixture(t)
|
||||||
|
defer f.tearDown()
|
||||||
|
|
||||||
|
root := f.paths[0]
|
||||||
|
ignore, _ := dockerignore.NewDockerPatternMatcher(root,
|
||||||
|
[]string{
|
||||||
|
"a/b",
|
||||||
|
"c",
|
||||||
|
"!c/d",
|
||||||
|
})
|
||||||
|
f.setIgnore(ignore)
|
||||||
|
|
||||||
|
a := f.JoinPath(root, "a")
|
||||||
|
b := f.JoinPath(a, "b")
|
||||||
|
file := f.JoinPath(b, "bigFile")
|
||||||
|
f.WriteFile(file, "hello")
|
||||||
|
f.assertEvents(a)
|
||||||
|
|
||||||
|
expectedWatches := 2
|
||||||
|
if runtime.GOOS == "darwin" {
|
||||||
|
expectedWatches = 1
|
||||||
|
}
|
||||||
|
assert.Equal(t, expectedWatches, int(numberOfWatches.Value()))
|
||||||
|
}
|
||||||
|
|
||||||
func TestIgnoreInitialDir(t *testing.T) {
|
func TestIgnoreInitialDir(t *testing.T) {
|
||||||
f := newNotifyFixture(t)
|
f := newNotifyFixture(t)
|
||||||
defer f.tearDown()
|
defer f.tearDown()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user