File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ ## 2.5.1
6+
7+ - Fix skipping skipped responses during coverage tracking
8+
59## 2.5.0
610
711### New feature
Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- openapi_first (2.5.0 )
4+ openapi_first (2.5.1 )
55 hana (~> 1.3 )
66 json_schemer (>= 2.1 , < 3.0 )
77 openapi_parameters (>= 0.3.3 , < 2.0 )
Original file line number Diff line number Diff line change 11PATH
22 remote: ..
33 specs:
4- openapi_first (2.5.0 )
4+ openapi_first (2.5.1 )
55 hana (~> 1.3 )
66 json_schemer (>= 2.1 , < 3.0 )
77 openapi_parameters (>= 0.3.3 , < 2.0 )
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def track_request(validated_request)
3838 end
3939
4040 def track_response ( validated_response )
41- index [ validated_response . response_definition . key ] . track ( validated_response ) if validated_response . known?
41+ index [ validated_response . response_definition . key ] & .track ( validated_response ) if validated_response . known?
4242 end
4343
4444 def done?
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module OpenapiFirst
4- VERSION = '2.5.0 '
4+ VERSION = '2.5.1 '
55end
Original file line number Diff line number Diff line change 169169 expect ( plan . tasks [ 2 ] . status ) . to eq ( '4XX' )
170170 end
171171
172+ it 'ignores unknown responses' do
173+ request = Rack ::Request . new ( Rack ::MockRequest . env_for ( '/stuff/24' ) )
174+ response = Rack ::Response . new
175+ response . status = 208
176+ unknown_response = oad . validate_response ( request , response )
177+
178+ plan . track_response ( unknown_response )
179+
180+ expect ( plan . tasks . count ( &:finished? ) ) . to eq ( 0 )
181+ end
182+
183+ it 'ignores skipped responses' do
184+ plan = described_class . for ( oad , skip_response : -> ( res ) { res . status == '200' } )
185+
186+ plan . track_response ( valid_response )
187+
188+ expect ( plan . tasks . count ( &:finished? ) ) . to eq ( 0 )
189+ end
190+
172191 context 'with skip_response option' do
173192 let ( :plan ) do
174193 skip_response = -> ( response ) { response . status == '4XX' }
You can’t perform that action at this time.
0 commit comments