Skip to content

Commit

Permalink
Merge pull request #148 from MarvinJWendt/114-rename-assertdirexist-t…
Browse files Browse the repository at this point in the history
…o-assertdirexists
  • Loading branch information
MarvinJWendt committed Apr 7, 2022
2 parents b2df28d + 6b3d1f7 commit 71f8684
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
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

0 comments on commit 71f8684

Please sign in to comment.