Skip to content

Commit 3b4b244

Browse files
committed
test for empty aliases key
1 parent 37761c9 commit 3b4b244

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

command/alias_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,22 @@ hosts:
3535

3636
buf := bytes.NewBufferString("")
3737
defer config.StubWriteConfig(buf)()
38-
output, err := RunCommand("alias set co pr checkout -Rcool/repo")
38+
output, err := RunCommand("alias set co pr checkout")
3939

4040
if err != nil {
4141
t.Fatalf("unexpected error: %s", err)
4242
}
4343

44-
test.ExpectLines(t, output.String(), "TODO")
44+
test.ExpectLines(t, output.String(), "Added alias")
4545

46-
// TODO
46+
expected := `aliases:
47+
co: pr checkout
48+
hosts:
49+
github.com:
50+
user: OWNER
51+
oauth_token: token123
52+
`
53+
eq(t, buf.String(), expected)
4754
}
4855

4956
func TestAliasSet_existing_alias(t *testing.T) {

0 commit comments

Comments
 (0)