diff options
Diffstat (limited to 'actionpack')
61 files changed, 36 insertions, 91 deletions
diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index d10ba5d635..22aadb9dfa 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -324,7 +324,6 @@ module ActionController def opaque(secret_key) ::Digest::MD5.hexdigest(secret_key) end - end # Makes it dead easy to do HTTP Token authentication. diff --git a/actionpack/lib/action_controller/metal/implicit_render.rb b/actionpack/lib/action_controller/metal/implicit_render.rb index c4a1b00a54..9332da5721 100644 --- a/actionpack/lib/action_controller/metal/implicit_render.rb +++ b/actionpack/lib/action_controller/metal/implicit_render.rb @@ -27,7 +27,6 @@ module ActionController # Finally, if we DON'T find a template AND the request isn't a browser page # load, then we implicitly respond with 204 No Content. module ImplicitRender - # :stopdoc: include BasicImplicitRender diff --git a/actionpack/lib/action_controller/metal/live.rb b/actionpack/lib/action_controller/metal/live.rb index 0f74ec25ff..a18055c899 100644 --- a/actionpack/lib/action_controller/metal/live.rb +++ b/actionpack/lib/action_controller/metal/live.rb @@ -84,7 +84,6 @@ module ActionController # Note: SSEs are not currently supported by IE. However, they are supported # by Chrome, Firefox, Opera, and Safari. class SSE - WHITELISTED_OPTIONS = %w( retry event id ) def initialize(stream, options = {}) diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb index b86fe8ceb4..15377ddcb9 100644 --- a/actionpack/lib/action_controller/metal/renderers.rb +++ b/actionpack/lib/action_controller/metal/renderers.rb @@ -94,7 +94,6 @@ module ActionController end module ClassMethods - # Adds, by name, a renderer or renderers to the +_renderers+ available # to call within controller actions. # diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 506548db5d..19bd18e110 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -320,7 +320,6 @@ module ActionController attr_reader :response, :request module ClassMethods - # Sets the controller class name. Useful if the name can't be inferred from test class. # Normalizes +controller_class+ before using. # diff --git a/actionpack/lib/action_dispatch/http/cache.rb b/actionpack/lib/action_dispatch/http/cache.rb index 40fe96c2a3..985e0fb972 100644 --- a/actionpack/lib/action_dispatch/http/cache.rb +++ b/actionpack/lib/action_dispatch/http/cache.rb @@ -2,7 +2,6 @@ module ActionDispatch module Http module Cache module Request - HTTP_IF_MODIFIED_SINCE = "HTTP_IF_MODIFIED_SINCE".freeze HTTP_IF_NONE_MATCH = "HTTP_IF_NONE_MATCH".freeze diff --git a/actionpack/lib/action_dispatch/http/filter_redirect.rb b/actionpack/lib/action_dispatch/http/filter_redirect.rb index 840234dbcb..fc3c44582a 100644 --- a/actionpack/lib/action_dispatch/http/filter_redirect.rb +++ b/actionpack/lib/action_dispatch/http/filter_redirect.rb @@ -1,7 +1,6 @@ module ActionDispatch module Http module FilterRedirect - FILTERED = "[FILTERED]".freeze # :nodoc: def filtered_location # :nodoc: @@ -31,7 +30,6 @@ module ActionDispatch end end end - end end end diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 2087ad02cd..e85ea90b94 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -302,7 +302,7 @@ module ActionDispatch # req.standard_port # => 80 def standard_port case protocol - when "https://" then 443 + when "https://" then 443 else 80 end end diff --git a/actionpack/lib/action_dispatch/journey/parser.rb b/actionpack/lib/action_dispatch/journey/parser.rb index 9b4707369b..38984edd3b 100644 --- a/actionpack/lib/action_dispatch/journey/parser.rb +++ b/actionpack/lib/action_dispatch/journey/parser.rb @@ -192,7 +192,6 @@ module ActionDispatch def _reduce_none(val, _values) val[0] end - end # class Parser end # module Journey end # module ActionDispatch diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb index 0f2ae00bc0..0902b9233e 100644 --- a/actionpack/lib/action_dispatch/journey/path/pattern.rb +++ b/actionpack/lib/action_dispatch/journey/path/pattern.rb @@ -4,7 +4,7 @@ module ActionDispatch class Pattern # :nodoc: attr_reader :spec, :requirements, :anchored - def self.from_string string + def self.from_string(string) build(string, {}, "/.?", true) end diff --git a/actionpack/lib/action_dispatch/journey/route.rb b/actionpack/lib/action_dispatch/journey/route.rb index f437897522..a9713ff292 100644 --- a/actionpack/lib/action_dispatch/journey/route.rb +++ b/actionpack/lib/action_dispatch/journey/route.rb @@ -38,7 +38,6 @@ module ActionDispatch hash[verb.downcase] = klass hash[verb.downcase.to_sym] = klass end - end def self.verb_matcher(verb) diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb index 513ef08410..727763c972 100644 --- a/actionpack/lib/action_dispatch/journey/router.rb +++ b/actionpack/lib/action_dispatch/journey/router.rb @@ -92,7 +92,7 @@ module ActionDispatch simulator.memos(path) { [] } end - def find_routes req + def find_routes(req) routes = filter_routes(req.path_info).concat custom_routes.find_all { |r| r.path.match(req.path_info) } diff --git a/actionpack/lib/action_dispatch/journey/visitors.rb b/actionpack/lib/action_dispatch/journey/visitors.rb index 8476c5d079..452dc84cc5 100644 --- a/actionpack/lib/action_dispatch/journey/visitors.rb +++ b/actionpack/lib/action_dispatch/journey/visitors.rb @@ -57,7 +57,7 @@ module ActionDispatch private - def visit node + def visit(node) send(DISPATCH_CACHE[node.type], node) end @@ -97,7 +97,7 @@ module ActionDispatch visit(node, seed) end - def visit node, seed + def visit(node, seed) send(DISPATCH_CACHE[node.type], node, seed) end diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index 755bc0d315..5f96b80e87 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -10,7 +10,6 @@ module ActionDispatch # Raised when raw data from the request cannot be parsed by the parser # defined for request's content mime type. class ParseError < StandardError - def initialize(message = nil, original_exception = nil) if message ActiveSupport::Deprecation.warn("Passing #message is deprecated and has no effect. " \ diff --git a/actionpack/lib/action_dispatch/middleware/remote_ip.rb b/actionpack/lib/action_dispatch/middleware/remote_ip.rb index 101950aae3..523eeb5b05 100644 --- a/actionpack/lib/action_dispatch/middleware/remote_ip.rb +++ b/actionpack/lib/action_dispatch/middleware/remote_ip.rb @@ -176,8 +176,6 @@ module ActionDispatch @proxies.any? { |proxy| proxy === ip } end end - end - end end diff --git a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb index d903338a2b..60920ea6c8 100644 --- a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb @@ -7,7 +7,6 @@ require "action_dispatch/request/session" module ActionDispatch module Session class SessionRestoreError < StandardError #:nodoc: - def initialize(const_error = nil) if const_error ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. " \ diff --git a/actionpack/lib/action_dispatch/request/utils.rb b/actionpack/lib/action_dispatch/request/utils.rb index ba622131e7..282bdbd2be 100644 --- a/actionpack/lib/action_dispatch/request/utils.rb +++ b/actionpack/lib/action_dispatch/request/utils.rb @@ -1,7 +1,6 @@ module ActionDispatch class Request class Utils # :nodoc: - mattr_accessor :perform_deep_munge self.perform_deep_munge = true diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb index 25784cfd70..abb51ce357 100644 --- a/actionpack/lib/action_dispatch/routing/redirection.rb +++ b/actionpack/lib/action_dispatch/routing/redirection.rb @@ -133,7 +133,6 @@ module ActionDispatch end module Redirection - # Redirect any path to another path: # # get "/stories" => redirect("/posts") diff --git a/actionpack/test/abstract/callbacks_test.rb b/actionpack/test/abstract/callbacks_test.rb index be68dc49bd..a0f2efa330 100644 --- a/actionpack/test/abstract/callbacks_test.rb +++ b/actionpack/test/abstract/callbacks_test.rb @@ -2,7 +2,6 @@ require "abstract_unit" module AbstractController module Testing - class ControllerWithCallbacks < AbstractController::Base include AbstractController::Callbacks end diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index c887b868d2..367eb90831 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -141,7 +141,7 @@ class ActionDispatch::IntegrationTest < ActiveSupport::TestCase end end - def make_request env + def make_request(env) NullControllerRequest.new super end end @@ -382,18 +382,18 @@ class ForkingExecutor @queue = Queue.new end - def record reporter, result + def record(reporter, result) reporter.record result end - def << o + def <<(o) o[2] = DRbObject.new(o[2]) if o @queue << o end def pop; @queue.pop; end end - def initialize size + def initialize(size) @size = size @queue = Server.new file = File.join Dir.tmpdir, Dir::Tmpname.make_tmpname("rails-tests", "fd") @@ -402,7 +402,7 @@ class ForkingExecutor DRb.start_service @url, @queue end - def << work; @queue << work; end + def <<(work); @queue << work; end def shutdown pool = @size.times.map { diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index ab3db80119..55b4c1e6a6 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -2,7 +2,6 @@ require "abstract_unit" require "controller/fake_controllers" class ActionPackAssertionsController < ActionController::Base - def nothing() head :ok end def hello_xml_world() render template: "test/hello_xml_world"; end @@ -130,7 +129,6 @@ module Admin end class ActionPackAssertionsControllerTest < ActionController::TestCase - def test_render_file_absolute_path get :render_file_absolute_path assert_match(/\A= Action Pack/, @response.body) diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index ec6441fe61..2edcbc7433 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -58,7 +58,6 @@ class ActionMissingController < ActionController::Base end class ControllerClassTests < ActiveSupport::TestCase - def test_controller_path assert_equal "empty", EmptyController.controller_path assert_equal EmptyController.controller_path, EmptyController.new.controller_path diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 5ee0d33c01..97d77706d1 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -296,7 +296,6 @@ CACHED end class CacheHelperOutputBufferTest < ActionController::TestCase - class MockController def read_fragment(name, options) return false diff --git a/actionpack/test/controller/default_url_options_with_before_action_test.rb b/actionpack/test/controller/default_url_options_with_before_action_test.rb index 386a0883c5..703f9f1fde 100644 --- a/actionpack/test/controller/default_url_options_with_before_action_test.rb +++ b/actionpack/test/controller/default_url_options_with_before_action_test.rb @@ -1,7 +1,6 @@ require "abstract_unit" class ControllerWithBeforeActionAndDefaultUrlOptions < ActionController::Base - before_action { I18n.locale = params[:locale] } after_action { I18n.locale = "en" } @@ -19,7 +18,6 @@ class ControllerWithBeforeActionAndDefaultUrlOptions < ActionController::Base end class ControllerWithBeforeActionAndDefaultUrlOptionsTest < ActionController::TestCase - # This test has its roots in issue #1872 test "should redirect with correct locale :de" do get :redirect, params: { locale: "de" } diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index fc4083d611..237711452a 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -494,7 +494,6 @@ class FilterTest < ActionController::TestCase end class NonYieldingAroundFilterController < ActionController::Base - before_action :filter_one around_action :non_yielding_action before_action :action_two @@ -522,7 +521,6 @@ class FilterTest < ActionController::TestCase def action_three @filters << "action_three" end - end class ImplicitActionsController < ActionController::Base diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index 8cda95337c..0d6a441789 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -835,7 +835,6 @@ class MetalIntegrationTest < ActionDispatch::IntegrationTest get "https://test.com:80" assert_equal "test.com:80", @request.env["HTTP_HOST"] end - end class ApplicationIntegrationTest < ActionDispatch::IntegrationTest diff --git a/actionpack/test/controller/mime/respond_to_test.rb b/actionpack/test/controller/mime/respond_to_test.rb index 385158b17c..26545686df 100644 --- a/actionpack/test/controller/mime/respond_to_test.rb +++ b/actionpack/test/controller/mime/respond_to_test.rb @@ -278,10 +278,10 @@ class RespondToController < ActionController::Base protected def set_layout case action_name - when "all_types_with_layout", "iphone_with_html_response_type" - "respond_to/layouts/standard" - when "iphone_with_html_response_type_without_layout" - "respond_to/layouts/missing" + when "all_types_with_layout", "iphone_with_html_response_type" + "respond_to/layouts/standard" + when "iphone_with_html_response_type_without_layout" + "respond_to/layouts/missing" end end end diff --git a/actionpack/test/controller/new_base/content_negotiation_test.rb b/actionpack/test/controller/new_base/content_negotiation_test.rb index 8f63a7eab1..8e83e1966a 100644 --- a/actionpack/test/controller/new_base/content_negotiation_test.rb +++ b/actionpack/test/controller/new_base/content_negotiation_test.rb @@ -1,7 +1,6 @@ require "abstract_unit" module ContentNegotiation - # This has no layout and it works class BasicController < ActionController::Base self.view_paths = [ActionView::FixtureResolver.new( diff --git a/actionpack/test/controller/new_base/render_action_test.rb b/actionpack/test/controller/new_base/render_action_test.rb index f87c29f977..e88f83b594 100644 --- a/actionpack/test/controller/new_base/render_action_test.rb +++ b/actionpack/test/controller/new_base/render_action_test.rb @@ -42,7 +42,6 @@ module RenderAction def hello_world_with_custom_layout render action: "hello_world", layout: "greetings" end - end class RenderActionTest < Rack::TestCase @@ -196,7 +195,6 @@ module RenderActionWithApplicationLayout assert_response "<html>\n<p>Hello</p>\n</html>\n" end end - end module RenderActionWithControllerLayout diff --git a/actionpack/test/controller/new_base/render_layout_test.rb b/actionpack/test/controller/new_base/render_layout_test.rb index b94406d3d3..0a3809560e 100644 --- a/actionpack/test/controller/new_base/render_layout_test.rb +++ b/actionpack/test/controller/new_base/render_layout_test.rb @@ -55,7 +55,6 @@ module ControllerLayouts get "/controller_layouts/implicit/override" assert_body "Override! Hello world!" end - end class LayoutOptionsTest < Rack::TestCase diff --git a/actionpack/test/controller/new_base/render_partial_test.rb b/actionpack/test/controller/new_base/render_partial_test.rb index 68455582f1..4511826978 100644 --- a/actionpack/test/controller/new_base/render_partial_test.rb +++ b/actionpack/test/controller/new_base/render_partial_test.rb @@ -1,9 +1,7 @@ require "abstract_unit" module RenderPartial - class BasicController < ActionController::Base - self.view_paths = [ActionView::FixtureResolver.new( "render_partial/basic/_basic.html.erb" => "BasicPartial!", "render_partial/basic/basic.html.erb" => "<%= @test_unchanged = 'goodbye' %><%= render :partial => 'basic' %><%= @test_unchanged %>", @@ -59,5 +57,4 @@ module RenderPartial assert_response("goodbyeOverriddenPartial!goodbye") end end - end diff --git a/actionpack/test/controller/new_base/render_template_test.rb b/actionpack/test/controller/new_base/render_template_test.rb index e56cefbda1..1102305f3e 100644 --- a/actionpack/test/controller/new_base/render_template_test.rb +++ b/actionpack/test/controller/new_base/render_template_test.rb @@ -2,7 +2,6 @@ require "abstract_unit" module RenderTemplate class WithoutLayoutController < ActionController::Base - self.view_paths = [ActionView::FixtureResolver.new( "test/basic.html.erb" => "Hello from basic.html.erb", "shared.html.erb" => "Elastica", diff --git a/actionpack/test/controller/new_base/render_xml_test.rb b/actionpack/test/controller/new_base/render_xml_test.rb index cff6f94818..8bab413377 100644 --- a/actionpack/test/controller/new_base/render_xml_test.rb +++ b/actionpack/test/controller/new_base/render_xml_test.rb @@ -1,7 +1,6 @@ require "abstract_unit" module RenderXml - # This has no layout and it works class BasicController < ActionController::Base self.view_paths = [ActionView::FixtureResolver.new( diff --git a/actionpack/test/controller/output_escaping_test.rb b/actionpack/test/controller/output_escaping_test.rb index 64016b3641..c7047d95ae 100644 --- a/actionpack/test/controller/output_escaping_test.rb +++ b/actionpack/test/controller/output_escaping_test.rb @@ -1,7 +1,6 @@ require "abstract_unit" class OutputEscapingTest < ActiveSupport::TestCase - test "escape_html shouldn't die when passed nil" do assert ERB::Util.h(nil).blank? end @@ -13,5 +12,4 @@ class OutputEscapingTest < ActiveSupport::TestCase test "escapeHTML shouldn't touch explicitly safe strings" do assert_equal "<", ERB::Util.h("<".html_safe) end - end diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb index 7467d5a78f..b42288636e 100644 --- a/actionpack/test/controller/parameters/parameters_permit_test.rb +++ b/actionpack/test/controller/parameters/parameters_permit_test.rb @@ -27,7 +27,7 @@ class ParametersPermitTest < ActiveSupport::TestCase end end - def walk_permitted params + def walk_permitted(params) params.each do |k,v| case v when ActionController::Parameters diff --git a/actionpack/test/controller/params_wrapper_test.rb b/actionpack/test/controller/params_wrapper_test.rb index 3b30fb2574..7800ff26d0 100644 --- a/actionpack/test/controller/params_wrapper_test.rb +++ b/actionpack/test/controller/params_wrapper_test.rb @@ -283,7 +283,6 @@ class NamespacedParamsWrapperTest < ActionController::TestCase Object.send :remove_const, :User end end - end class AnonymousControllerParamsWrapperTest < ActionController::TestCase diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 399c500094..ba556c1bff 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -247,7 +247,7 @@ class TestController < ActionController::Base def determine_layout case action_name - when "hello_world", "layout_test", "rendering_without_layout", + when "hello_world", "layout_test", "rendering_without_layout", "rendering_nothing_on_layout", "render_text_hello_world", "render_text_hello_world_with_layout", "hello_world_with_layout_false", @@ -257,11 +257,11 @@ class TestController < ActionController::Base "render_with_explicit_string_template", "update_page", "update_page_with_instance_variables" - "layouts/standard" - when "action_talk_to_layout", "layout_overriding_layout" - "layouts/talk_from_action" - when "render_implicit_html_template_from_xhr_request" - (request.xhr? ? "layouts/xhr" : "layouts/standard") + "layouts/standard" + when "action_talk_to_layout", "layout_overriding_layout" + "layouts/talk_from_action" + when "render_implicit_html_template_from_xhr_request" + (request.xhr? ? "layouts/xhr" : "layouts/standard") end end end diff --git a/actionpack/test/controller/renderers_test.rb b/actionpack/test/controller/renderers_test.rb index 78d5105794..122f5be549 100644 --- a/actionpack/test/controller/renderers_test.rb +++ b/actionpack/test/controller/renderers_test.rb @@ -26,7 +26,6 @@ class RenderersTest < ActionController::TestCase end end class TestController < ActionController::Base - def render_simon_says render simon: "foo" end diff --git a/actionpack/test/controller/request/test_request_test.rb b/actionpack/test/controller/request/test_request_test.rb index e697f2da74..6e0ca957c3 100644 --- a/actionpack/test/controller/request/test_request_test.rb +++ b/actionpack/test/controller/request/test_request_test.rb @@ -2,7 +2,6 @@ require "abstract_unit" require "stringio" class ActionController::TestRequestTest < ActionController::TestCase - def test_test_request_has_session_options_initialized assert @request.session_options end @@ -19,5 +18,4 @@ class ActionController::TestRequestTest < ActionController::TestCase "Missing rack session option #{option} in request.session_options") end end - end diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb index e2724ded83..2e6b7be88b 100644 --- a/actionpack/test/controller/request_forgery_protection_test.rb +++ b/actionpack/test/controller/request_forgery_protection_test.rb @@ -52,7 +52,6 @@ module RequestForgeryProtectionActions def negotiate_cross_origin negotiate_same_origin end - end # sample controllers diff --git a/actionpack/test/controller/required_params_test.rb b/actionpack/test/controller/required_params_test.rb index 15131b3217..c9b0ac874d 100644 --- a/actionpack/test/controller/required_params_test.rb +++ b/actionpack/test/controller/required_params_test.rb @@ -32,7 +32,6 @@ class ActionControllerRequiredParamsTest < ActionController::TestCase end class ParametersRequireTest < ActiveSupport::TestCase - test "required parameters should accept and return false value" do assert_equal(false, ActionController::Parameters.new(person: false).require(:person)) end diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb index 5b1363d5e1..a98e6479b7 100644 --- a/actionpack/test/controller/rescue_test.rb +++ b/actionpack/test/controller/rescue_test.rb @@ -160,7 +160,6 @@ class RescueController < ActionController::Base end class ExceptionInheritanceRescueController < ActionController::Base - class ParentException < StandardError end diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 192a1540a7..05293dd94c 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -208,7 +208,7 @@ class LegacyRouteSetTests < ActiveSupport::TestCase def test_class_and_lambda_constraints subdomain = Class.new { - def matches? request + def matches?(request) request.subdomain.present? and request.subdomain != "clients" end } diff --git a/actionpack/test/dispatch/callbacks_test.rb b/actionpack/test/dispatch/callbacks_test.rb index ca3154e16e..57e21a22c6 100644 --- a/actionpack/test/dispatch/callbacks_test.rb +++ b/actionpack/test/dispatch/callbacks_test.rb @@ -60,5 +60,4 @@ class DispatcherTest < ActiveSupport::TestCase "rack.input" => StringIO.new("") ) end - end diff --git a/actionpack/test/dispatch/debug_exceptions_test.rb b/actionpack/test/dispatch/debug_exceptions_test.rb index f35d193f5a..b55bd9b204 100644 --- a/actionpack/test/dispatch/debug_exceptions_test.rb +++ b/actionpack/test/dispatch/debug_exceptions_test.rb @@ -1,7 +1,6 @@ require "abstract_unit" class DebugExceptionsTest < ActionDispatch::IntegrationTest - class Boomer attr_accessor :closed diff --git a/actionpack/test/dispatch/routing/inspector_test.rb b/actionpack/test/dispatch/routing/inspector_test.rb index 07d0a8aefd..115770b7cd 100644 --- a/actionpack/test/dispatch/routing/inspector_test.rb +++ b/actionpack/test/dispatch/routing/inspector_test.rb @@ -177,7 +177,7 @@ module ActionDispatch assert_equal [ "Prefix Verb URI Pattern Controller#Action", - %Q[ GET /photos/:id(.:format) photos#show {:format=>"jpg"}] + ' GET /photos/:id(.:format) photos#show {:format=>"jpg"}' ], output end @@ -419,7 +419,6 @@ module ActionDispatch "custom_assets GET /custom/assets(.:format) custom_assets#show", ], output end - end end end diff --git a/actionpack/test/dispatch/routing/ipv6_redirect_test.rb b/actionpack/test/dispatch/routing/ipv6_redirect_test.rb index b227aca658..4987ed84e4 100644 --- a/actionpack/test/dispatch/routing/ipv6_redirect_test.rb +++ b/actionpack/test/dispatch/routing/ipv6_redirect_test.rb @@ -41,5 +41,4 @@ class IPv6IntegrationTest < ActionDispatch::IntegrationTest assert_response :redirect assert_equal "http://[fd07:2fa:6cff:2112:225:90ff:fec7:22aa]:3000/", redirect_to_url end - end diff --git a/actionpack/test/dispatch/routing_assertions_test.rb b/actionpack/test/dispatch/routing_assertions_test.rb index 1f8ce059d1..56ab4e883f 100644 --- a/actionpack/test/dispatch/routing_assertions_test.rb +++ b/actionpack/test/dispatch/routing_assertions_test.rb @@ -6,7 +6,6 @@ class BlockArticlesController < ArticlesController; end class QueryArticlesController < ArticlesController; end class RoutingAssertionsTest < ActionController::TestCase - def setup @routes = ActionDispatch::Routing::RouteSet.new @routes.draw do diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 486c0e162d..e64dedf817 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -4071,7 +4071,6 @@ class TestTildeAndMinusPaths < ActionDispatch::IntegrationTest get "/young-and-fine" assert_equal "200", @response.code end - end class TestRedirectInterpolation < ActionDispatch::IntegrationTest diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb index 1dbaa2ab00..013d289c6d 100644 --- a/actionpack/test/dispatch/session/cookie_store_test.rb +++ b/actionpack/test/dispatch/session/cookie_store_test.rb @@ -360,5 +360,4 @@ class CookieStoreTest < ActionDispatch::IntegrationTest yield end end - end diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index 8c82a51dd6..d8f673c212 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -1,7 +1,6 @@ require "abstract_unit" class ShowExceptionsTest < ActionDispatch::IntegrationTest - class Boomer def call(env) req = ActionDispatch::Request.new(env) diff --git a/actionpack/test/dispatch/ssl_test.rb b/actionpack/test/dispatch/ssl_test.rb index 4effc62853..ccddb90bb5 100644 --- a/actionpack/test/dispatch/ssl_test.rb +++ b/actionpack/test/dispatch/ssl_test.rb @@ -12,7 +12,6 @@ class SSLTest < ActionDispatch::IntegrationTest end class RedirectSSLTest < SSLTest - def assert_not_redirected(url, headers: {}, redirect: {}, deprecated_host: nil, deprecated_port: nil) diff --git a/actionpack/test/dispatch/static_test.rb b/actionpack/test/dispatch/static_test.rb index 11dd3a5964..404cc00cd1 100644 --- a/actionpack/test/dispatch/static_test.rb +++ b/actionpack/test/dispatch/static_test.rb @@ -303,7 +303,6 @@ class StaticTest < ActiveSupport::TestCase assert_html "/foo/other-index.html", get("/foo/") assert_html "/foo/other-index.html", get("/foo") end - end class StaticEncodingTest < StaticTest diff --git a/actionpack/test/dispatch/url_generation_test.rb b/actionpack/test/dispatch/url_generation_test.rb index 0472be0d6a..5d81fd6834 100644 --- a/actionpack/test/dispatch/url_generation_test.rb +++ b/actionpack/test/dispatch/url_generation_test.rb @@ -135,6 +135,5 @@ module TestUrlGeneration format: "json" ) end - end end diff --git a/actionpack/test/journey/gtg/builder_test.rb b/actionpack/test/journey/gtg/builder_test.rb index 5861cd2414..2b314cdd4e 100644 --- a/actionpack/test/journey/gtg/builder_test.rb +++ b/actionpack/test/journey/gtg/builder_test.rb @@ -59,7 +59,7 @@ module ActionDispatch end private - def ast strings + def ast(strings) parser = Journey::Parser.new asts = strings.map { |string| memo = Object.new @@ -70,7 +70,7 @@ module ActionDispatch Nodes::Or.new asts end - def tt strings + def tt(strings) Builder.new(ast(strings)).transition_table end end diff --git a/actionpack/test/journey/gtg/transition_table_test.rb b/actionpack/test/journey/gtg/transition_table_test.rb index 566eb4d186..23b05cc5f6 100644 --- a/actionpack/test/journey/gtg/transition_table_test.rb +++ b/actionpack/test/journey/gtg/transition_table_test.rb @@ -91,7 +91,7 @@ module ActionDispatch end private - def asts paths + def asts(paths) parser = Journey::Parser.new paths.map { |x| ast = parser.parse x @@ -100,13 +100,13 @@ module ActionDispatch } end - def tt paths + def tt(paths) x = asts paths builder = GTG::Builder.new Nodes::Or.new x builder.transition_table end - def simulator_for paths + def simulator_for(paths) GTG::Simulator.new tt(paths) end end diff --git a/actionpack/test/journey/nfa/simulator_test.rb b/actionpack/test/journey/nfa/simulator_test.rb index 117208c4a4..918b971fec 100644 --- a/actionpack/test/journey/nfa/simulator_test.rb +++ b/actionpack/test/journey/nfa/simulator_test.rb @@ -86,7 +86,7 @@ module ActionDispatch assert_equal [asts.first], md.memos end - def simulator_for paths + def simulator_for(paths) parser = Journey::Parser.new asts = paths.map { |x| parser.parse x } builder = Builder.new Nodes::Or.new asts diff --git a/actionpack/test/journey/nfa/transition_table_test.rb b/actionpack/test/journey/nfa/transition_table_test.rb index c948880c47..f3cf36a064 100644 --- a/actionpack/test/journey/nfa/transition_table_test.rb +++ b/actionpack/test/journey/nfa/transition_table_test.rb @@ -61,7 +61,7 @@ module ActionDispatch end private - def tt string + def tt(string) ast = @parser.parse string builder = Builder.new ast builder.transition_table diff --git a/actionpack/test/journey/route/definition/parser_test.rb b/actionpack/test/journey/route/definition/parser_test.rb index 8e00d8ab89..8c6e3c0371 100644 --- a/actionpack/test/journey/route/definition/parser_test.rb +++ b/actionpack/test/journey/route/definition/parser_test.rb @@ -101,7 +101,7 @@ module ActionDispatch assert_round_trip "/(:locale)(.:format)" end - def assert_round_trip str + def assert_round_trip(str) assert_equal str, @parser.parse(str).to_s end end diff --git a/actionpack/test/journey/route/definition/scanner_test.rb b/actionpack/test/journey/route/definition/scanner_test.rb index 82a50cf539..98578ddbf1 100644 --- a/actionpack/test/journey/route/definition/scanner_test.rb +++ b/actionpack/test/journey/route/definition/scanner_test.rb @@ -56,7 +56,7 @@ module ActionDispatch end end - def assert_tokens tokens, scanner + def assert_tokens(tokens, scanner) toks = [] while tok = scanner.next_token toks << tok diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb index efe7bef5c5..c75475bffb 100644 --- a/actionpack/test/journey/router_test.rb +++ b/actionpack/test/journey/router_test.rb @@ -493,23 +493,23 @@ module ActionDispatch private - def get *args + def get(*args) ActiveSupport::Deprecation.silence do mapper.get(*args) end end - def match *args + def match(*args) ActiveSupport::Deprecation.silence do mapper.match(*args) end end - def rails_env env, klass = ActionDispatch::Request + def rails_env(env, klass = ActionDispatch::Request) klass.new(rack_env(env)) end - def rack_env env + def rack_env(env) { "rack.version" => [1, 1], "rack.input" => StringIO.new, |