From 6fc6a0f0ab8ce8c7b6ec510d1d7557a6e7cd6835 Mon Sep 17 00:00:00 2001 From: Steve Moyer Date: Wed, 22 Jun 2022 10:38:09 -0400 Subject: test(809): remove reliance on repo's filesystem --- commands/user_create_test.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'commands/user_create_test.go') 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) } -- cgit