-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the container and config tests into a test package (#2242)
* Move the container and config tests into a test package This work has been extracted from #2202 and is related to #2180. See the original PR for the full context and reasoning. * Rename the utils file * Remove some unused code
- Loading branch information
Showing
4 changed files
with
79 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This test is testing very internal logic that should not be exported away from this package. We'll | ||
// leave it in the main testcontainers package. Do not use for user facing examples. | ||
package testcontainers | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestParseDockerIgnore(t *testing.T) { | ||
testCases := []struct { | ||
filePath string | ||
expectedErr error | ||
expectedExcluded []string | ||
}{ | ||
{ | ||
filePath: "./testdata/dockerignore", | ||
expectedErr: nil, | ||
expectedExcluded: []string{"vendor", "foo", "bar"}, | ||
}, | ||
{ | ||
filePath: "./testdata", | ||
expectedErr: nil, | ||
expectedExcluded: []string{"Dockerfile", "echo.Dockerfile"}, | ||
}, | ||
} | ||
|
||
for _, testCase := range testCases { | ||
excluded, err := parseDockerIgnore(testCase.filePath) | ||
assert.Equal(t, testCase.expectedErr, err) | ||
assert.Equal(t, testCase.expectedExcluded, excluded) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters