aboutsummaryrefslogtreecommitdiffstats
path: root/commands/user_create_test.go
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-06-15 09:07:00 -0400
committerSteve Moyer <smoyer1@selesy.com>2022-06-15 09:07:00 -0400
commit0a9aaa94429172d14297f709ec2137cd3749cfea (patch)
tree8a5ed7f8168d3aadfb1b80a86f2d4bbe97bf2742 /commands/user_create_test.go
parent941f5b3fc362be388dd3bd979799dd296daec243 (diff)
downloadgit-bug-0a9aaa94429172d14297f709ec2137cd3749cfea.tar.gz
refactor(778): test only command implementations
Diffstat (limited to 'commands/user_create_test.go')
-rw-r--r--commands/user_create_test.go21
1 files changed, 9 insertions, 12 deletions
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"))
}