diff options
author | Steve Moyer <smoyer1@selesy.com> | 2022-06-21 06:48:28 -0400 |
---|---|---|
committer | Steve Moyer <smoyer1@selesy.com> | 2022-06-21 06:48:28 -0400 |
commit | 52c724a03334dda9df30dbac22cb22a04cbe4260 (patch) | |
tree | 5320d6076a015d7e64d3d601922ca7f1559173e5 | |
parent | f3d316d16cc9fadd90faaaf77becbb82f1e09367 (diff) | |
download | git-bug-52c724a03334dda9df30dbac22cb22a04cbe4260.tar.gz |
test: use testing.TB as common interface
-rw-r--r-- | repository/gogit_testing.go | 8 | ||||
-rw-r--r-- | repository/mock_repo_test.go | 2 | ||||
-rw-r--r-- | repository/repo_testing.go | 2 |
3 files changed, 3 insertions, 9 deletions
diff --git a/repository/gogit_testing.go b/repository/gogit_testing.go index 01be54de..3e6f72fc 100644 --- a/repository/gogit_testing.go +++ b/repository/gogit_testing.go @@ -9,17 +9,11 @@ import ( "github.com/99designs/keyring" ) -type TestingT interface { - Cleanup(func()) - Helper() - TempDir() string -} - const namespace = "git-bug" // This is intended for testing only -func CreateGoGitTestRepo(t TestingT, bare bool) TestedRepo { +func CreateGoGitTestRepo(t testing.TB, bare bool) TestedRepo { t.Helper() dir := t.TempDir() diff --git a/repository/mock_repo_test.go b/repository/mock_repo_test.go index f43e7ea6..66fad7b6 100644 --- a/repository/mock_repo_test.go +++ b/repository/mock_repo_test.go @@ -5,7 +5,7 @@ import ( ) func TestMockRepo(t *testing.T) { - creator := func(t TestingT, bare bool) TestedRepo { return NewMockRepo() } + creator := func(t testing.TB, bare bool) TestedRepo { return NewMockRepo() } RepoTest(t, creator) } diff --git a/repository/repo_testing.go b/repository/repo_testing.go index c5bbe0c4..5d51d23f 100644 --- a/repository/repo_testing.go +++ b/repository/repo_testing.go @@ -13,7 +13,7 @@ import ( // TODO: add tests for RepoBleve // TODO: add tests for RepoStorage -type RepoCreator func(t TestingT, bare bool) TestedRepo +type RepoCreator func(t testing.TB, bare bool) TestedRepo // Test suite for a Repo implementation func RepoTest(t *testing.T, creator RepoCreator) { |