aboutsummaryrefslogtreecommitdiffstats
path: root/commands/user_create_test.go
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-06-22 10:38:09 -0400
committerSteve Moyer <smoyer1@selesy.com>2022-06-22 10:38:09 -0400
commit6fc6a0f0ab8ce8c7b6ec510d1d7557a6e7cd6835 (patch)
tree9cd772fc325ed8a15c76306f458c4fef736fd94d /commands/user_create_test.go
parent52c724a03334dda9df30dbac22cb22a04cbe4260 (diff)
downloadgit-bug-6fc6a0f0ab8ce8c7b6ec510d1d7557a6e7cd6835.tar.gz
test(809): remove reliance on repo's filesystem
Diffstat (limited to 'commands/user_create_test.go')
-rw-r--r--commands/user_create_test.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/commands/user_create_test.go b/commands/user_create_test.go
index 223e7ec3..08958344 100644
--- a/commands/user_create_test.go
+++ b/commands/user_create_test.go
@@ -1,21 +1,25 @@
package commands
import (
- "path/filepath"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
+const (
+ testUserName = "John Doe"
+ testUserEmail = "jdoe@example.com"
+)
+
func newTestEnvAndUser(t *testing.T) (*testEnv, string) {
t.Helper()
testEnv := newTestEnv(t)
opts := createUserOptions{
- name: "John Doe",
- email: "jdoe@example.com",
+ name: testUserName,
+ email: testUserEmail,
avatarURL: "",
nonInteractive: true,
}
@@ -29,8 +33,6 @@ func newTestEnvAndUser(t *testing.T) (*testEnv, string) {
}
func TestUserCreateCommand(t *testing.T) {
- testEnv, userID := newTestEnvAndUser(t)
-
- require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "refs", "identities", userID))
- require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "git-bug", "identity-cache"))
+ _, userID := newTestEnvAndUser(t)
+ require.Regexp(t, "[0-9a-f]{64}", userID)
}