diff options
author | Steve Moyer <smoyer1@selesy.com> | 2022-06-15 09:07:00 -0400 |
---|---|---|
committer | Steve Moyer <smoyer1@selesy.com> | 2022-06-15 09:07:00 -0400 |
commit | 0a9aaa94429172d14297f709ec2137cd3749cfea (patch) | |
tree | 8a5ed7f8168d3aadfb1b80a86f2d4bbe97bf2742 /commands/add_test.go | |
parent | 941f5b3fc362be388dd3bd979799dd296daec243 (diff) | |
download | git-bug-0a9aaa94429172d14297f709ec2137cd3749cfea.tar.gz |
refactor(778): test only command implementations
Diffstat (limited to 'commands/add_test.go')
-rw-r--r-- | commands/add_test.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/commands/add_test.go b/commands/add_test.go index b85c7fa2..63eda06e 100644 --- a/commands/add_test.go +++ b/commands/add_test.go @@ -1,4 +1,4 @@ -package commands_test +package commands import ( "strings" @@ -11,15 +11,14 @@ func newTestEnvUserAndBug(t *testing.T) (*testEnv, string, string) { t.Helper() testEnv, userID := newTestEnvAndUser(t) - - testEnv.cmd.SetArgs([]string{ - "add", - "--non-interactive", - "-t 'this is a bug title'", - "-m 'this is a bug message'", - }) - - testEnv.Execute(t) + opts := addOptions{ + title: "this is a bug title", + message: "this is a bug message", + messageFile: "", + nonInteractive: true, + } + + require.NoError(t, runAdd(testEnv.env, opts)) require.Regexp(t, "^[0-9A-Fa-f]{7} created\n$", testEnv.out) bugID := strings.Split(testEnv.out.String(), " ")[0] testEnv.out.Reset() |