@@ -128,59 +128,59 @@ def runtime
128128 client . config . instrumentation = instrumentation
129129 # Inject instrumentation into middleware instance
130130 allow_any_instance_of ( ZendeskAPI ::Middleware ::Request ::Retry ) . to receive ( :instrumentation ) . and_return ( instrumentation )
131- stub_request ( :get , %r{instrumented} ) . to_return ( : status => 429 , : headers => { : retry_after => 1 } ) . to_return ( : status => 200 )
131+ stub_request ( :get , %r{instrumented} ) . to_return ( status : 429 , headers : { retry_after : 1 } ) . to_return ( status : 200 )
132132 end
133133
134134 it "calls instrumentation on retry" do
135135 expect ( instrumentation ) . to receive ( :instrument ) . with (
136136 "zendesk.retry" ,
137- hash_including ( : attempt => 1 , : endpoint => anything , : method => anything , : reason => anything , : delay => anything )
137+ hash_including ( attempt : 1 , endpoint : anything , method : anything , reason : anything , delay : anything )
138138 ) . at_least ( :once )
139139 client . connection . get ( "instrumented" )
140140 end
141141
142142 it "calls instrumentation on second retry attempt" do
143143 # Override stub for this test to force two rate limit responses before success
144- stub_request ( :get , %r{instrumented_twice} ) .
145- to_return ( : status => 429 , : headers => { : retry_after => 0 } ) .
146- to_return ( : status => 429 , : headers => { : retry_after => 0 } ) .
147- to_return ( : status => 200 )
144+ stub_request ( :get , %r{instrumented_twice} )
145+ . to_return ( status : 429 , headers : { retry_after : 0 } )
146+ . to_return ( status : 429 , headers : { retry_after : 0 } )
147+ . to_return ( status : 200 )
148148
149149 # Expect instrumentation for attempt 1 and attempt 2
150150 expect ( instrumentation ) . to receive ( :instrument ) . with (
151151 "zendesk.retry" ,
152- hash_including ( : attempt => 1 , : endpoint => anything , : method => anything , : reason => ' rate_limited' , : delay => anything )
152+ hash_including ( attempt : 1 , endpoint : anything , method : anything , reason : " rate_limited" , delay : anything )
153153 ) . at_least ( :once )
154154 expect ( instrumentation ) . to receive ( :instrument ) . with (
155155 "zendesk.retry" ,
156- hash_including ( : attempt => 2 , : endpoint => anything , : method => anything , : reason => ' rate_limited' , : delay => anything )
156+ hash_including ( attempt : 2 , endpoint : anything , method : anything , reason : " rate_limited" , delay : anything )
157157 ) . at_least ( :once )
158158
159159 client . connection . get ( "instrumented_twice" )
160160 end
161161
162162 it "calls instrumentation with first attempt server error, and rate limited on second retry attempt" do
163163 # Override stub for this test to force two rate limit responses before success
164- stub_request ( :get , %r{instrumented_twice} ) .
165- to_return ( : status => 503 , : headers => { : retry_after => 0 } ) .
166- to_return ( : status => 429 , : headers => { : retry_after => 0 } ) .
167- to_return ( : status => 200 )
164+ stub_request ( :get , %r{instrumented_twice} )
165+ . to_return ( status : 503 , headers : { retry_after : 0 } )
166+ . to_return ( status : 429 , headers : { retry_after : 0 } )
167+ . to_return ( status : 200 )
168168
169169 # Expect instrumentation for attempt 1 and attempt 2
170170 expect ( instrumentation ) . to receive ( :instrument ) . with (
171171 "zendesk.retry" ,
172- hash_including ( : attempt => 1 , : endpoint => anything , : method => anything , : reason => ' server_error' , : delay => anything )
172+ hash_including ( attempt : 1 , endpoint : anything , method : anything , reason : " server_error" , delay : anything )
173173 ) . at_least ( :once )
174174 expect ( instrumentation ) . to receive ( :instrument ) . with (
175175 "zendesk.retry" ,
176- hash_including ( : attempt => 2 , : endpoint => anything , : method => anything , : reason => ' rate_limited' , : delay => anything )
176+ hash_including ( attempt : 2 , endpoint : anything , method : anything , reason : " rate_limited" , delay : anything )
177177 ) . at_least ( :once )
178178
179179 client . connection . get ( "instrumented_twice" )
180180 end
181181
182182 it "does not call instrumentation when no retry occurs" do
183- stub_request ( :get , %r{no_retry} ) . to_return ( : status => 200 )
183+ stub_request ( :get , %r{no_retry} ) . to_return ( status : 200 )
184184 expect ( instrumentation ) . not_to receive ( :instrument ) . with (
185185 "zendesk.retry" ,
186186 hash_including ( :attempt , :endpoint , :method , :reason , :delay )
0 commit comments