Closed jodosha closed 4 years ago
Changes are only related to testing code
Rack 2.1 removed Rack::Response#to_ary in favor of explicit #to_a, which makes the following syntax to not work anymore:
Rack::Response#to_ary
#to_a
# before status, header, body = router.call(env)
# after status, header, body = router.call(env).to_a
Response is no longer a Rack::BodyProxy but a plain Array with one String element
Rack::BodyProxy
Array
String
I had to disable a test because:
bundle exec rspec spec/integration/hanami/router/pass_on_response_spec.rb Randomized with seed 19626 Pass on response /Users/luca/.gem/ruby/2.7.0/gems/http_router-0.11.2/lib/http_router/node/abstract_request_node.rb:29: warning: mismatched indentations at 'end' with 'class' at 3 /Users/luca/.gem/ruby/2.7.0/gems/http_router-0.11.2/lib/http_router/request.rb:10: warning: URI.unescape is obsolete is successful (FAILED - 1) Failures: 1) Pass on response is successful Failure/Error: response = @app.get('/', lint: true) NoMethodError: undefined method `to_i' for #<Rack::Response:0x00007f8c8e3d36b0> Did you mean? to_s to_a # /Users/luca/.gem/ruby/2.7.0/gems/rack-2.1.1/lib/rack/lint.rb:621:in `block in check_status' # /Users/luca/.gem/ruby/2.7.0/gems/rack-2.1.1/lib/rack/lint.rb:21:in `assert' # /Users/luca/.gem/ruby/2.7.0/gems/rack-2.1.1/lib/rack/lint.rb:621:in `check_status' # /Users/luca/.gem/ruby/2.7.0/gems/rack-2.1.1/lib/rack/lint.rb:53:in `_call' # /Users/luca/.gem/ruby/2.7.0/gems/rack-2.1.1/lib/rack/lint.rb:39:in `call' # /Users/luca/.gem/ruby/2.7.0/gems/rack-2.1.1/lib/rack/mock.rb:77:in `request' # /Users/luca/.gem/ruby/2.7.0/gems/rack-2.1.1/lib/rack/mock.rb:59:in `get' # ./spec/integration/hanami/router/pass_on_response_spec.rb:8:in `block (2 levels) in <top (required)>' Top 1 slowest examples (0.01482 seconds, 76.6% of total time): Pass on response is successful 0.01482 seconds ./spec/integration/hanami/router/pass_on_response_spec.rb:7 Finished in 0.01935 seconds (files took 0.23748 seconds to load) 1 example, 1 failure Failed examples: rspec ./spec/integration/hanami/router/pass_on_response_spec.rb:7 # Pass on response is successful Randomized with seed 19626
Technical notes
Changes are only related to testing code
Rack 2.1 removed
Rack::Response#to_ary
in favor of explicit#to_a
, which makes the following syntax to not work anymore:Response is no longer a
Rack::BodyProxy
but a plainArray
with oneString
elementI had to disable a test because: