@@ -73,7 +73,7 @@ func TestAbilityApiCall(t *testing.T) {
7373
7474 ability , name , err := AbilityApiCall ("/ability" , "unaware" , ts .URL )
7575
76- assert .NoError (t , err , "Expected no error on successful API call" )
76+ require .NoError (t , err , "Expected no error on successful API call" )
7777 assert .Equal (t , expectedAbility , ability , "Expected ability struct does not match" )
7878 assert .Equal (t , "unaware" , name , "Expected ability name does not match" )
7979 })
@@ -85,11 +85,10 @@ func TestAbilityApiCall(t *testing.T) {
8585 }))
8686 defer ts .Close ()
8787
88- ability , name , err := AbilityApiCall ("/ability" , "non-existent-ability" , ts .URL )
88+ ability , _ , err := AbilityApiCall ("/ability" , "non-existent-ability" , ts .URL )
8989
90- assert .Error (t , err , "Expected an error for invalid ability" )
90+ require .Error (t , err , "Expected an error for invalid ability" )
9191 assert .Equal (t , structs.AbilityJSONStruct {}, ability , "Expected empty ability struct on error" )
92- assert .Equal (t , "" , name , "Expected empty ability name on error" )
9392
9493 assert .Contains (t , err .Error (), "Ability not found" , "Expected 'Ability not found' in error message" )
9594 assert .Contains (t , err .Error (), "Perhaps a typo?" , "Expected helpful suggestion in error message" )
@@ -111,7 +110,7 @@ func TestMoveApiCall(t *testing.T) {
111110
112111 move , name , err := MoveApiCall ("/move" , "shadow-ball" , ts .URL )
113112
114- assert .NoError (t , err , "Expected no error on successful API call" )
113+ require .NoError (t , err , "Expected no error on successful API call" )
115114 assert .Equal (t , expectedMove , move , "Expected move struct does not match" )
116115 assert .Equal (t , "shadow-ball" , name , "Expected move name does not match" )
117116 })
@@ -123,11 +122,10 @@ func TestMoveApiCall(t *testing.T) {
123122 }))
124123 defer ts .Close ()
125124
126- move , name , err := MoveApiCall ("/move" , "non-existent-move" , ts .URL )
125+ move , _ , err := MoveApiCall ("/move" , "non-existent-move" , ts .URL )
127126
128- assert .Error (t , err , "Expected an error for invalid move" )
127+ require .Error (t , err , "Expected an error for invalid move" )
129128 assert .Equal (t , structs.MoveJSONStruct {}, move , "Expected empty move struct on error" )
130- assert .Equal (t , "" , name , "Expected empty move name on error" )
131129
132130 assert .Contains (t , err .Error (), "Move not found" , "Expected 'Move not found' in error message" )
133131 assert .Contains (t , err .Error (), "Perhaps a typo?" , "Expected helpful suggestion in error message" )
@@ -149,7 +147,7 @@ func TestPokemonApiCall(t *testing.T) {
149147
150148 pokemon , name , err := PokemonApiCall ("/pokemon" , "flareon" , ts .URL )
151149
152- assert .NoError (t , err , "Expected no error on successful API call" )
150+ require .NoError (t , err , "Expected no error on successful API call" )
153151 assert .Equal (t , expectedPokemon , pokemon , "Expected pokemon struct does not match" )
154152 assert .Equal (t , "flareon" , name , "Expected pokemon name does not match" )
155153 })
@@ -161,11 +159,10 @@ func TestPokemonApiCall(t *testing.T) {
161159 }))
162160 defer ts .Close ()
163161
164- pokemon , name , err := PokemonApiCall ("/pokemon" , "non-existent-pokemon" , ts .URL )
162+ pokemon , _ , err := PokemonApiCall ("/pokemon" , "non-existent-pokemon" , ts .URL )
165163
166- assert .Error (t , err , "Expected an error for invalid pokemon" )
164+ require .Error (t , err , "Expected an error for invalid pokemon" )
167165 assert .Equal (t , structs.PokemonJSONStruct {}, pokemon , "Expected empty pokemon struct on error" )
168- assert .Equal (t , "" , name , "Expected empty pokemon name on error" )
169166
170167 assert .Contains (t , err .Error (), "Pokémon not found" , "Expected 'Pokémon not found' in error message" )
171168 assert .Contains (t , err .Error (), "Perhaps a typo?" , "Expected helpful suggestion in error message" )
0 commit comments