X Tutup
Skip to content

Commit bba2d6d

Browse files
committed
improve test cases
1 parent b833428 commit bba2d6d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/cmd/api/api_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ func Test_fillPlaceholders(t *testing.T) {
757757
{
758758
name: "has branch placeholder",
759759
args: args{
760-
value: "repos/cli/cli/branches/:branch",
760+
value: "repos/cli/cli/branches/:branch/protection/required_status_checks",
761761
opts: &ApiOptions{
762762
BaseRepo: func() (ghrepo.Interface, error) {
763763
return ghrepo.New("cli", "cli"), nil
@@ -767,13 +767,13 @@ func Test_fillPlaceholders(t *testing.T) {
767767
},
768768
},
769769
},
770-
want: "repos/cli/cli/branches/trunk",
770+
want: "repos/cli/cli/branches/trunk/protection/required_status_checks",
771771
wantErr: false,
772772
},
773773
{
774-
name: "has branch placeholder and git is on detached head",
774+
name: "has branch placeholder and git is in detached head",
775775
args: args{
776-
value: "repos/cli/cli/branches/:branch",
776+
value: "repos/:owner/:repo/branches/:branch",
777777
opts: &ApiOptions{
778778
BaseRepo: func() (ghrepo.Interface, error) {
779779
return ghrepo.New("cli", "cli"), nil
@@ -783,7 +783,7 @@ func Test_fillPlaceholders(t *testing.T) {
783783
},
784784
},
785785
},
786-
want: "repos/cli/cli/branches/:branch",
786+
want: "repos/:owner/:repo/branches/:branch",
787787
wantErr: true,
788788
},
789789
{

0 commit comments

Comments
 (0)
X Tutup