Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING] Renamed AssertDirExist to AssertDirExists #148

Merged
merged 5 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</a>

<a href="https://codecov.io/gh/MarvinJWendt/testza">
<!-- unittestcount:start --><img src="https://img.shields.io/badge/Unit_Tests-3201-magenta?style=flat-square" alt="Unit test count"><!-- unittestcount:end -->
<!-- unittestcount:start --><img src="https://img.shields.io/badge/Unit_Tests-3209-magenta?style=flat-square" alt="Unit test count"><!-- unittestcount:end -->
</a>

<a href="https://pkg.go.dev/github.com/MarvinJWendt/testza" target="_blank">
Expand Down Expand Up @@ -160,7 +160,7 @@ testza.FuzzStringRunTests(t, emailAddresses, func(t *testing.T, index int, str s
- [AssertContains](https://github.com/MarvinJWendt/testza#AssertContains)
- [AssertDecreasing](https://github.com/MarvinJWendt/testza#AssertDecreasing)
- [AssertDirEmpty](https://github.com/MarvinJWendt/testza#AssertDirEmpty)
- [AssertDirExist](https://github.com/MarvinJWendt/testza#AssertDirExist)
- [AssertDirExists](https://github.com/MarvinJWendt/testza#AssertDirExists)
- [AssertDirNotEmpty](https://github.com/MarvinJWendt/testza#AssertDirNotEmpty)
- [AssertEqual](https://github.com/MarvinJWendt/testza#AssertEqual)
- [AssertEqualValues](https://github.com/MarvinJWendt/testza#AssertEqualValues)
Expand Down Expand Up @@ -387,13 +387,13 @@ Example:

testza.AssertDirEmpty(t, "FolderName")

#### AssertDirExist
#### AssertDirExists

```go
func AssertDirExist(t testRunner, dir string, msg ...interface{})
func AssertDirExists(t testRunner, dir string, msg ...interface{})
```

AssertDirExist asserts that a directory exists. The test will pass when the
AssertDirExists asserts that a directory exists. The test will pass when the
directory exists, and it's visible to the current user. The test will fail,
if the path points to a file.

Expand All @@ -402,7 +402,7 @@ used.

Example:

testza.AssertDirExist(t, "FolderName")
testza.AssertDirExists(t, "FolderName")

#### AssertDirNotEmpty

Expand Down
6 changes: 3 additions & 3 deletions assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -791,15 +791,15 @@ func AssertNoFileExists(t testRunner, file string, msg ...interface{}) {
}
}

// AssertDirExist asserts that a directory exists.
// AssertDirExists asserts that a directory exists.
// The test will pass when the directory exists, and it's visible to the current user.
// The test will fail, if the path points to a file.
//
// When using a custom message, the same formatting as with fmt.Sprintf() is used.
//
// Example:
// testza.AssertDirExist(t, "FolderName")
func AssertDirExist(t testRunner, dir string, msg ...interface{}) {
// testza.AssertDirExists(t, "FolderName")
func AssertDirExists(t testRunner, dir string, msg ...interface{}) {
if test, ok := t.(helper); ok {
test.Helper()
}
Expand Down
4 changes: 2 additions & 2 deletions assert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ func TestAssertNoFileExists_fail(t *testing.T) {
func TestAssertDirExists(t *testing.T) {
for _, dir := range []string{"ci", "internal", "testdata", os.TempDir()} {
t.Run(dir, func(t *testing.T) {
AssertDirExist(t, dir)
AssertDirExists(t, dir)
})
}
}
Expand All @@ -1252,7 +1252,7 @@ func TestAssertDirExists_fail(t *testing.T) {
for _, dir := range []string{"asdasdasdasd", "LICENSE", "CHANGELOG.md"} {
t.Run(dir, func(t *testing.T) {
AssertTestFails(t, func(t TestingPackageWithFailFunctions) {
AssertDirExist(t, dir)
AssertDirExists(t, dir)
})
})
}
Expand Down
4 changes: 2 additions & 2 deletions output/fail_assertions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func TestOutput(t *testing.T) {
testza.AssertDirEmpty(t, ".")
})

t.Run("AssertDirExist", func(t *testing.T) {
testza.AssertDirExist(t, ".")
t.Run("AssertDirExists", func(t *testing.T) {
testza.AssertDirExists(t, ".")
})

t.Run("AssertDirNotEmpty", func(t *testing.T) {
Expand Down