lib/rack/app/test.rb in rack-app-5.10.1 vs lib/rack/app/test.rb in rack-app-5.10.2

- old
+ new

@@ -12,10 +12,10 @@ attr_reader :last_response def __send_rack_app_request__(request_method, *args) properties = args.select { |e| e.is_a?(Hash) }.reduce({}, &:merge!) - url = args.select { |e| e.is_a?(String) }.first || properties.delete(:url) + url = args.detect { |e| e.is_a?(String) } || properties.delete(:url) mock_request = Rack::MockRequest.new(rack_app) request_env = Rack::App::Test::Utils.env_by(properties) return @last_response = mock_request.request(request_method.to_s.upcase, url, request_env) end