File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -609,11 +609,6 @@ func Test_App_Add_Method_Test(t *testing.T) {
609
609
610
610
func Test_App_All_Method_Test (t * testing.T ) {
611
611
t .Parallel ()
612
- defer func () {
613
- if err := recover (); err != nil {
614
- require .Equal (t , "add: invalid http method JANE\n " , fmt .Sprintf ("%v" , err ))
615
- }
616
- }()
617
612
618
613
methods := append (DefaultMethods , "JOHN" ) //nolint:gocritic // We want a new slice here
619
614
app := New (Config {
@@ -628,11 +623,9 @@ func Test_App_All_Method_Test(t *testing.T) {
628
623
require .Equal (t , StatusOK , resp .StatusCode , "Status code" )
629
624
630
625
// Add a new method
631
- app .Add ([]string {"JANE" }, "/doe" , testEmptyHandler )
632
-
633
- resp , err = app .Test (httptest .NewRequest ("JANE" , "/doe" , nil ))
634
- require .NoError (t , err , "app.Test(req)" )
635
- require .Equal (t , StatusOK , resp .StatusCode , "Status code" )
626
+ require .Panics (t , func () {
627
+ app .Add ([]string {"JANE" }, "/jane" , testEmptyHandler )
628
+ })
636
629
}
637
630
638
631
// go test -run Test_App_GETOnly
You can’t perform that action at this time.
0 commit comments