hanami / router

Ruby/Rack HTTP router
http://hanamirb.org
MIT License
362 stars 92 forks source link

Rack 2.1 #197

Closed jodosha closed 4 years ago

jodosha commented 4 years ago

Technical notes

# before
status, header, body = router.call(env)
# after
status, header, body = router.call(env).to_a
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