improve test cases

This commit is contained in:
Francisco Miamoto 2020-08-12 09:07:52 -03:00
parent b83342856b
commit bba2d6d204

View file

@ -757,7 +757,7 @@ func Test_fillPlaceholders(t *testing.T) {
{
name: "has branch placeholder",
args: args{
value: "repos/cli/cli/branches/:branch",
value: "repos/cli/cli/branches/:branch/protection/required_status_checks",
opts: &ApiOptions{
BaseRepo: func() (ghrepo.Interface, error) {
return ghrepo.New("cli", "cli"), nil
@ -767,13 +767,13 @@ func Test_fillPlaceholders(t *testing.T) {
},
},
},
want: "repos/cli/cli/branches/trunk",
want: "repos/cli/cli/branches/trunk/protection/required_status_checks",
wantErr: false,
},
{
name: "has branch placeholder and git is on detached head",
name: "has branch placeholder and git is in detached head",
args: args{
value: "repos/cli/cli/branches/:branch",
value: "repos/:owner/:repo/branches/:branch",
opts: &ApiOptions{
BaseRepo: func() (ghrepo.Interface, error) {
return ghrepo.New("cli", "cli"), nil
@ -783,7 +783,7 @@ func Test_fillPlaceholders(t *testing.T) {
},
},
},
want: "repos/cli/cli/branches/:branch",
want: "repos/:owner/:repo/branches/:branch",
wantErr: true,
},
{