From 0a9aaa94429172d14297f709ec2137cd3749cfea Mon Sep 17 00:00:00 2001 From: Steve Moyer Date: Wed, 15 Jun 2022 09:07:00 -0400 Subject: refactor(778): test only command implementations --- commands/user_create_test.go | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'commands/user_create_test.go') diff --git a/commands/user_create_test.go b/commands/user_create_test.go index 07ed657b..223e7ec3 100644 --- a/commands/user_create_test.go +++ b/commands/user_create_test.go @@ -1,4 +1,4 @@ -package commands_test +package commands import ( "path/filepath" @@ -13,16 +13,15 @@ func newTestEnvAndUser(t *testing.T) (*testEnv, string) { testEnv := newTestEnv(t) - testEnv.cmd.SetArgs( - []string{ - "user", - "create", - "--non-interactive", - "-n John Doe", - "-e jdoe@example.com", - }) + opts := createUserOptions{ + name: "John Doe", + email: "jdoe@example.com", + avatarURL: "", + nonInteractive: true, + } + + require.NoError(t, runUserCreate(testEnv.env, opts)) - testEnv.Execute(t) userID := strings.TrimSpace(testEnv.out.String()) testEnv.out.Reset() @@ -32,8 +31,6 @@ func newTestEnvAndUser(t *testing.T) (*testEnv, string) { func TestUserCreateCommand(t *testing.T) { testEnv, userID := newTestEnvAndUser(t) - t.Log("CWD:", testEnv.cwd) - require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "refs", "identities", userID)) require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "git-bug", "identity-cache")) } -- cgit