diff options
Diffstat (limited to 'actionpack/test')
31 files changed, 298 insertions, 301 deletions
diff --git a/actionpack/test/abstract/callbacks_test.rb b/actionpack/test/abstract/callbacks_test.rb index 14d73e8372..be68dc49bd 100644 --- a/actionpack/test/abstract/callbacks_test.rb +++ b/actionpack/test/abstract/callbacks_test.rb @@ -126,14 +126,14 @@ module AbstractController end private - def list - @list = ["Hello", "World"] - end - - def authenticate - @list ||= [] - @authenticated = "true" - end + def list + @list = ["Hello", "World"] + end + + def authenticate + @list ||= [] + @authenticated = "true" + end end class TestCallbacksWithConditions < ActiveSupport::TestCase @@ -170,14 +170,14 @@ module AbstractController end private - def list - @list = ["Hello", "World"] - end - - def authenticate - @list = [] - @authenticated = "true" - end + def list + @list = ["Hello", "World"] + end + + def authenticate + @list = [] + @authenticated = "true" + end end class TestCallbacksWithArrayConditions < ActiveSupport::TestCase diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 075ebd3974..c887b868d2 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -254,11 +254,11 @@ end module ActionDispatch class DebugExceptions private - remove_method :stderr_logger + remove_method :stderr_logger # Silence logger - def stderr_logger - nil - end + def stderr_logger + nil + end end end @@ -348,9 +348,9 @@ module RoutingTestHelpers private - def make_request(env) - Request.new super, url_helpers, @block, strict - end + def make_request(env) + Request.new super, url_helpers, @block, strict + end end end @@ -426,18 +426,18 @@ class ForkingExecutor end private - def translate_exceptions(result) - result.failures.map! { |e| - begin - Marshal.dump e - e - rescue TypeError - ex = Exception.new e.message - ex.set_backtrace e.backtrace - Minitest::UnexpectedError.new ex - end - } - end + def translate_exceptions(result) + result.failures.map! { |e| + begin + Marshal.dump e + e + rescue TypeError + ex = Exception.new e.message + ex.set_backtrace e.backtrace + Minitest::UnexpectedError.new ex + end + } + end end if RUBY_ENGINE == "ruby" && PROCESS_COUNT > 0 diff --git a/actionpack/test/controller/api/conditional_get_test.rb b/actionpack/test/controller/api/conditional_get_test.rb index 330bfac1c9..7b70829101 100644 --- a/actionpack/test/controller/api/conditional_get_test.rb +++ b/actionpack/test/controller/api/conditional_get_test.rb @@ -17,9 +17,9 @@ class ConditionalGetApiController < ActionController::API private - def handle_last_modified_and_etags - fresh_when(last_modified: Time.now.utc.beginning_of_day, etag: [ :foo, 123 ]) - end + def handle_last_modified_and_etags + fresh_when(last_modified: Time.now.utc.beginning_of_day, etag: [ :foo, 123 ]) + end end class ConditionalGetApiTest < ActionController::TestCase diff --git a/actionpack/test/controller/content_type_test.rb b/actionpack/test/controller/content_type_test.rb index 47bc8c4983..fcb2632b80 100644 --- a/actionpack/test/controller/content_type_test.rb +++ b/actionpack/test/controller/content_type_test.rb @@ -131,13 +131,13 @@ class ContentTypeTest < ActionController::TestCase private - def with_default_charset(charset) - old_default_charset = ActionDispatch::Response.default_charset - ActionDispatch::Response.default_charset = charset - yield - ensure - ActionDispatch::Response.default_charset = old_default_charset - end + def with_default_charset(charset) + old_default_charset = ActionDispatch::Response.default_charset + ActionDispatch::Response.default_charset = charset + yield + ensure + ActionDispatch::Response.default_charset = old_default_charset + end end class AcceptBasedContentTypeTest < ActionController::TestCase diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index 0ddf825864..fc4083d611 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -56,14 +56,14 @@ class FilterTest < ActionController::TestCase end protected - (1..3).each do |i| - define_method "try_#{i}" do - instance_variable_set :@try, i - if action_name == "fail_#{i}" - head(404) + (1..3).each do |i| + define_method "try_#{i}" do + instance_variable_set :@try, i + if action_name == "fail_#{i}" + head(404) + end end end - end end class RenderingController < ActionController::Base @@ -531,13 +531,13 @@ class FilterTest < ActionController::TestCase private - def find_only - @only = "Only" - end + def find_only + @only = "Only" + end - def find_except - @except = "Except" - end + def find_except + @except = "Except" + end end def test_non_yielding_around_actions_do_not_raise @@ -931,26 +931,26 @@ class ControllerWithAllTypesOfFilters < PostsController around_action :around_again private - def before - @ran_filter ||= [] - @ran_filter << "before" - end + def before + @ran_filter ||= [] + @ran_filter << "before" + end - def around - @ran_filter << "around (before yield)" - yield - @ran_filter << "around (after yield)" - end + def around + @ran_filter << "around (before yield)" + yield + @ran_filter << "around (after yield)" + end - def after - @ran_filter << "after" - end + def after + @ran_filter << "after" + end - def around_again - @ran_filter << "around_again (before yield)" - yield - @ran_filter << "around_again (after yield)" - end + def around_again + @ran_filter << "around_again (before yield)" + yield + @ran_filter << "around_again (after yield)" + end end class ControllerWithTwoLessFilters < ControllerWithAllTypesOfFilters diff --git a/actionpack/test/controller/http_basic_authentication_test.rb b/actionpack/test/controller/http_basic_authentication_test.rb index c980d0ed35..d9ae787689 100644 --- a/actionpack/test/controller/http_basic_authentication_test.rb +++ b/actionpack/test/controller/http_basic_authentication_test.rb @@ -31,31 +31,31 @@ class HttpBasicAuthenticationTest < ActionController::TestCase private - def authenticate - authenticate_or_request_with_http_basic do |username, password| - username == "lifo" && password == "world" + def authenticate + authenticate_or_request_with_http_basic do |username, password| + username == "lifo" && password == "world" + end end - end - def authenticate_with_request - if authenticate_with_http_basic { |username, password| username == "pretty" && password == "please" } - @logged_in = true - else - request_http_basic_authentication("SuperSecret", "Authentication Failed\n") + def authenticate_with_request + if authenticate_with_http_basic { |username, password| username == "pretty" && password == "please" } + @logged_in = true + else + request_http_basic_authentication("SuperSecret", "Authentication Failed\n") + end end - end - def auth_with_special_chars - authenticate_or_request_with_http_basic do |username, password| - username == 'login!@#$%^&*()_+{}[];"\',./<>?`~ \n\r\t' && password == 'pwd:!@#$%^&*()_+{}[];"\',./<>?`~ \n\r\t' + def auth_with_special_chars + authenticate_or_request_with_http_basic do |username, password| + username == 'login!@#$%^&*()_+{}[];"\',./<>?`~ \n\r\t' && password == 'pwd:!@#$%^&*()_+{}[];"\',./<>?`~ \n\r\t' + end end - end - def authenticate_long_credentials - authenticate_or_request_with_http_basic do |username, password| - username == "1234567890123456789012345678901234567890" && password == "1234567890123456789012345678901234567890" + def authenticate_long_credentials + authenticate_or_request_with_http_basic do |username, password| + username == "1234567890123456789012345678901234567890" && password == "1234567890123456789012345678901234567890" + end end - end end AUTH_HEADERS = ["HTTP_AUTHORIZATION", "X-HTTP_AUTHORIZATION", "X_HTTP_AUTHORIZATION", "REDIRECT_X_HTTP_AUTHORIZATION"] @@ -171,7 +171,7 @@ class HttpBasicAuthenticationTest < ActionController::TestCase private - def encode_credentials(username, password) - "Basic #{::Base64.encode64("#{username}:#{password}")}" - end + def encode_credentials(username, password) + "Basic #{::Base64.encode64("#{username}:#{password}")}" + end end diff --git a/actionpack/test/controller/http_digest_authentication_test.rb b/actionpack/test/controller/http_digest_authentication_test.rb index 854ec62774..5e9b801f8b 100644 --- a/actionpack/test/controller/http_digest_authentication_test.rb +++ b/actionpack/test/controller/http_digest_authentication_test.rb @@ -19,20 +19,20 @@ class HttpDigestAuthenticationTest < ActionController::TestCase private - def authenticate - authenticate_or_request_with_http_digest("SuperSecret") do |username| - # Returns the password - USERS[username] + def authenticate + authenticate_or_request_with_http_digest("SuperSecret") do |username| + # Returns the password + USERS[username] + end end - end - def authenticate_with_request - if authenticate_with_http_digest("SuperSecret") { |username| USERS[username] } - @logged_in = true - else - request_http_digest_authentication("SuperSecret", "Authentication Failed") + def authenticate_with_request + if authenticate_with_http_digest("SuperSecret") { |username| USERS[username] } + @logged_in = true + else + request_http_digest_authentication("SuperSecret", "Authentication Failed") + end end - end end AUTH_HEADERS = ["HTTP_AUTHORIZATION", "X-HTTP_AUTHORIZATION", "X_HTTP_AUTHORIZATION", "REDIRECT_X_HTTP_AUTHORIZATION"] @@ -249,32 +249,32 @@ class HttpDigestAuthenticationTest < ActionController::TestCase private - def encode_credentials(options) - options.reverse_merge!(nc: "00000001", cnonce: "0a4f113b", password_is_ha1: false) - password = options.delete(:password) + def encode_credentials(options) + options.reverse_merge!(nc: "00000001", cnonce: "0a4f113b", password_is_ha1: false) + password = options.delete(:password) - # Perform unauthenticated request to retrieve digest parameters to use on subsequent request - method = options.delete(:method) || "GET" + # Perform unauthenticated request to retrieve digest parameters to use on subsequent request + method = options.delete(:method) || "GET" - case method.to_s.upcase - when "GET" - get :index - when "POST" - post :index - end + case method.to_s.upcase + when "GET" + get :index + when "POST" + post :index + end - assert_response :unauthorized + assert_response :unauthorized - credentials = decode_credentials(@response.headers["WWW-Authenticate"]) - credentials.merge!(options) - path_info = @request.env["PATH_INFO"].to_s - uri = options[:uri] || path_info - credentials.merge!(uri: uri) - @request.env["ORIGINAL_FULLPATH"] = path_info - ActionController::HttpAuthentication::Digest.encode_credentials(method, credentials, password, options[:password_is_ha1]) - end + credentials = decode_credentials(@response.headers["WWW-Authenticate"]) + credentials.merge!(options) + path_info = @request.env["PATH_INFO"].to_s + uri = options[:uri] || path_info + credentials.merge!(uri: uri) + @request.env["ORIGINAL_FULLPATH"] = path_info + ActionController::HttpAuthentication::Digest.encode_credentials(method, credentials, password, options[:password_is_ha1]) + end - def decode_credentials(header) - ActionController::HttpAuthentication::Digest.decode_credentials(header) - end + def decode_credentials(header) + ActionController::HttpAuthentication::Digest.decode_credentials(header) + end end diff --git a/actionpack/test/controller/http_token_authentication_test.rb b/actionpack/test/controller/http_token_authentication_test.rb index 206fe18eda..b7a4c550d7 100644 --- a/actionpack/test/controller/http_token_authentication_test.rb +++ b/actionpack/test/controller/http_token_authentication_test.rb @@ -20,25 +20,25 @@ class HttpTokenAuthenticationTest < ActionController::TestCase private - def authenticate - authenticate_or_request_with_http_token do |token, _| - token == "lifo" + def authenticate + authenticate_or_request_with_http_token do |token, _| + token == "lifo" + end end - end - def authenticate_with_request - if authenticate_with_http_token { |token, options| token == '"quote" pretty' && options[:algorithm] == "test" } - @logged_in = true - else - request_http_token_authentication("SuperSecret", "Authentication Failed\n") + def authenticate_with_request + if authenticate_with_http_token { |token, options| token == '"quote" pretty' && options[:algorithm] == "test" } + @logged_in = true + else + request_http_token_authentication("SuperSecret", "Authentication Failed\n") + end end - end - def authenticate_long_credentials - authenticate_or_request_with_http_token do |token, options| - token == "1234567890123456789012345678901234567890" && options[:algorithm] == "test" + def authenticate_long_credentials + authenticate_or_request_with_http_token do |token, options| + token == "1234567890123456789012345678901234567890" && options[:algorithm] == "test" + end end - end end AUTH_HEADERS = ["HTTP_AUTHORIZATION", "X-HTTP_AUTHORIZATION", "X_HTTP_AUTHORIZATION", "REDIRECT_X_HTTP_AUTHORIZATION"] diff --git a/actionpack/test/controller/new_base/render_context_test.rb b/actionpack/test/controller/new_base/render_context_test.rb index 5df25d136c..40149a41d3 100644 --- a/actionpack/test/controller/new_base/render_context_test.rb +++ b/actionpack/test/controller/new_base/render_context_test.rb @@ -29,13 +29,13 @@ module RenderContext protected # 3) Set view_context to self - def view_context - self - end + def view_context + self + end - def __controller_method__ - "controller context!" - end + def __controller_method__ + "controller context!" + end end class RenderContextTest < Rack::TestCase diff --git a/actionpack/test/controller/new_base/render_template_test.rb b/actionpack/test/controller/new_base/render_template_test.rb index 13e4bbc1ea..e56cefbda1 100644 --- a/actionpack/test/controller/new_base/render_template_test.rb +++ b/actionpack/test/controller/new_base/render_template_test.rb @@ -67,9 +67,9 @@ module RenderTemplate private - def show_detailed_exceptions? - request.local? - end + def show_detailed_exceptions? + request.local? + end end class TestWithoutLayout < Rack::TestCase diff --git a/actionpack/test/controller/new_base/render_test.rb b/actionpack/test/controller/new_base/render_test.rb index 57006b2da0..cea3f9b5fd 100644 --- a/actionpack/test/controller/new_base/render_test.rb +++ b/actionpack/test/controller/new_base/render_test.rb @@ -36,9 +36,9 @@ module Render private - def secretz - render plain: "FAIL WHALE!" - end + def secretz + render plain: "FAIL WHALE!" + end end class DoubleRenderController < ActionController::Base diff --git a/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb b/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb index a6e48b8ded..bf2c3d1ed2 100644 --- a/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb +++ b/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb @@ -47,18 +47,18 @@ class LogOnUnpermittedParamsTest < ActiveSupport::TestCase private - def assert_logged(message) - old_logger = ActionController::Base.logger - log = StringIO.new - ActionController::Base.logger = Logger.new(log) + def assert_logged(message) + old_logger = ActionController::Base.logger + log = StringIO.new + ActionController::Base.logger = Logger.new(log) - begin - yield + begin + yield - log.rewind - assert_match message, log.read - ensure - ActionController::Base.logger = old_logger + log.rewind + assert_match message, log.read + ensure + ActionController::Base.logger = old_logger + end end - end end diff --git a/actionpack/test/controller/params_wrapper_test.rb b/actionpack/test/controller/params_wrapper_test.rb index 7d49e8d114..3b30fb2574 100644 --- a/actionpack/test/controller/params_wrapper_test.rb +++ b/actionpack/test/controller/params_wrapper_test.rb @@ -356,11 +356,11 @@ class IrregularInflectionParamsWrapperTest < ActionController::TestCase private - def with_dup - original = ActiveSupport::Inflector::Inflections.instance_variable_get(:@__instance__)[:en] - ActiveSupport::Inflector::Inflections.instance_variable_set(:@__instance__, en: original.dup) - yield - ensure - ActiveSupport::Inflector::Inflections.instance_variable_set(:@__instance__, en: original) - end + def with_dup + original = ActiveSupport::Inflector::Inflections.instance_variable_get(:@__instance__)[:en] + ActiveSupport::Inflector::Inflections.instance_variable_set(:@__instance__, en: original.dup) + yield + ensure + ActiveSupport::Inflector::Inflections.instance_variable_set(:@__instance__, en: original) + end end diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb index a0e92c1a4a..e2724ded83 100644 --- a/actionpack/test/controller/request_forgery_protection_test.rb +++ b/actionpack/test/controller/request_forgery_protection_test.rb @@ -95,19 +95,19 @@ class PrependProtectForgeryBaseController < ActionController::Base protected - def add_called_callback(name) - @called_callbacks ||= [] - @called_callbacks << name - end + def add_called_callback(name) + @called_callbacks ||= [] + @called_callbacks << name + end - def custom_action - add_called_callback("custom_action") - end + def custom_action + add_called_callback("custom_action") + end - def verify_authenticity_token - add_called_callback("verify_authenticity_token") - end + def verify_authenticity_token + add_called_callback("verify_authenticity_token") + end end class FreeCookieController < RequestForgeryProtectionControllerUsingResetSession diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index 36df54e1ff..6cb4b83208 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -770,25 +770,25 @@ class ResourcesTest < ActionController::TestCase assert_recognizes({controller: "messages", action: "index"}, "/messages/") end - with_routing do |set| - set.draw do - resources :messages, path: "reviews" - end - assert_simply_restful_for :messages, as: "reviews" - assert_recognizes({controller: "messages", action: "index"}, "/reviews") - assert_recognizes({controller: "messages", action: "index"}, "/reviews/") - end + with_routing do |set| + set.draw do + resources :messages, path: "reviews" + end + assert_simply_restful_for :messages, as: "reviews" + assert_recognizes({controller: "messages", action: "index"}, "/reviews") + assert_recognizes({controller: "messages", action: "index"}, "/reviews/") + end end def test_multiple_with_path_segment_and_controller with_routing do |set| set.draw do - resources :products do - resources :product_reviews, path: "reviews", controller: "messages" - end - resources :tutors do - resources :tutor_reviews, path: "reviews", controller: "comments" - end + resources :products do + resources :product_reviews, path: "reviews", controller: "messages" + end + resources :tutors do + resources :tutor_reviews, path: "reviews", controller: "comments" + end end assert_simply_restful_for :product_reviews, controller: "messages", as: "reviews", name_prefix: "product_", path_prefix: "products/1/", options: {product_id: "1"} @@ -1314,7 +1314,7 @@ class ResourcesTest < ActionController::TestCase assert_equal expected.length, resource.send("#{action_method}_methods")[method].size, "#{resource.send("#{action_method}_methods")[method].inspect}" expected.each do |action| assert resource.send("#{action_method}_methods")[method].include?(action) - "#{method} not in #{action_method} methods: #{resource.send("#{action_method}_methods")[method].inspect}" + "#{method} not in #{action_method} methods: #{resource.send("#{action_method}_methods")[method].inspect}" end end diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 0b2c7b7a4f..192a1540a7 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -739,7 +739,7 @@ class LegacyRouteSetTests < ActiveSupport::TestCase def test_named_root_url_generation_with_controller_and_action rs.draw do - root to: "content#index", as: "home" + root to: "content#index", as: "home" end assert_equal "/", url_for(rs, controller: "content", action: "index") diff --git a/actionpack/test/controller/show_exceptions_test.rb b/actionpack/test/controller/show_exceptions_test.rb index 9b93afd303..38c601ee81 100644 --- a/actionpack/test/controller/show_exceptions_test.rb +++ b/actionpack/test/controller/show_exceptions_test.rb @@ -50,9 +50,9 @@ module ShowExceptions class ShowExceptionsOverriddenController < ShowExceptionsController private - def show_detailed_exceptions? - params["detailed"] == "1" - end + def show_detailed_exceptions? + params["detailed"] == "1" + end end class ShowExceptionsOverriddenTest < ActionDispatch::IntegrationTest diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb index 81dc230929..d64ff4d6ce 100644 --- a/actionpack/test/controller/url_rewriter_test.rb +++ b/actionpack/test/controller/url_rewriter_test.rb @@ -88,4 +88,3 @@ class UrlRewriterTests < ActionController::TestCase assert_equal "/foo/bar/3/?query=string", @rewriter.rewrite(@routes, options) end end - diff --git a/actionpack/test/dispatch/request/session_test.rb b/actionpack/test/dispatch/request/session_test.rb index b599fe5437..cc3c4d48f3 100644 --- a/actionpack/test/dispatch/request/session_test.rb +++ b/actionpack/test/dispatch/request/session_test.rb @@ -106,13 +106,13 @@ module ActionDispatch end private - def store - Class.new { - def load_session(env); [1, {}]; end - def session_exists?(env); true; end - def delete_session(env, id, options); 123; end - }.new - end + def store + Class.new { + def load_session(env); [1, {}]; end + def session_exists?(env); true; end + def delete_session(env, id, options); 123; end + }.new + end end class SessionIntegrationTest < ActionDispatch::IntegrationTest diff --git a/actionpack/test/dispatch/request_id_test.rb b/actionpack/test/dispatch/request_id_test.rb index d64ee7607d..793ce67db4 100644 --- a/actionpack/test/dispatch/request_id_test.rb +++ b/actionpack/test/dispatch/request_id_test.rb @@ -23,10 +23,10 @@ class RequestIdTest < ActiveSupport::TestCase private - def stub_request(env = {}) - ActionDispatch::RequestId.new(lambda { |environment| [ 200, environment, [] ] }).call(env) - ActionDispatch::Request.new(env) - end + def stub_request(env = {}) + ActionDispatch::RequestId.new(lambda { |environment| [ 200, environment, [] ] }).call(env) + ActionDispatch::Request.new(env) + end end class RequestIdResponseTest < ActionDispatch::IntegrationTest @@ -53,17 +53,17 @@ class RequestIdResponseTest < ActionDispatch::IntegrationTest private - def with_test_route_set - with_routing do |set| - set.draw do - get "/", to: ::RequestIdResponseTest::TestController.action(:index) - end + def with_test_route_set + with_routing do |set| + set.draw do + get "/", to: ::RequestIdResponseTest::TestController.action(:index) + end - @app = self.class.build_app(set) do |middleware| - middleware.use ActionDispatch::RequestId - end + @app = self.class.build_app(set) do |middleware| + middleware.use ActionDispatch::RequestId + end - yield + yield + end end - end end diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 6994c7e897..486c0e162d 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -4781,9 +4781,9 @@ class TestPartialDynamicPathSegments < ActionDispatch::IntegrationTest private - def assert_params(params) - assert_equal(params, request.path_parameters) - end + def assert_params(params) + assert_equal(params, request.path_parameters) + end end class TestPathParameters < ActionDispatch::IntegrationTest diff --git a/actionpack/test/dispatch/session/abstract_store_test.rb b/actionpack/test/dispatch/session/abstract_store_test.rb index df81f7d7e3..fd4d359cf8 100644 --- a/actionpack/test/dispatch/session/abstract_store_test.rb +++ b/actionpack/test/dispatch/session/abstract_store_test.rb @@ -47,10 +47,10 @@ module ActionDispatch end private - def app(&block) - @env = nil - lambda { |env| @env = env } - end + def app(&block) + @env = nil + lambda { |env| @env = env } + end end end end diff --git a/actionpack/test/dispatch/url_generation_test.rb b/actionpack/test/dispatch/url_generation_test.rb index b5a792b456..0472be0d6a 100644 --- a/actionpack/test/dispatch/url_generation_test.rb +++ b/actionpack/test/dispatch/url_generation_test.rb @@ -138,4 +138,3 @@ module TestUrlGeneration end end - diff --git a/actionpack/test/fixtures/helpers/fun/games_helper.rb b/actionpack/test/fixtures/helpers/fun/games_helper.rb index 3b7adce086..2d5e50f5a5 100644 --- a/actionpack/test/fixtures/helpers/fun/games_helper.rb +++ b/actionpack/test/fixtures/helpers/fun/games_helper.rb @@ -2,4 +2,4 @@ module Fun module GamesHelper def stratego() "Iz guuut!" end end -end
\ No newline at end of file +end diff --git a/actionpack/test/fixtures/helpers/just_me_helper.rb b/actionpack/test/fixtures/helpers/just_me_helper.rb index b140a7b9b4..9b43fc6d49 100644 --- a/actionpack/test/fixtures/helpers/just_me_helper.rb +++ b/actionpack/test/fixtures/helpers/just_me_helper.rb @@ -1,3 +1,3 @@ module JustMeHelper def me() "mine!" end -end
\ No newline at end of file +end diff --git a/actionpack/test/fixtures/helpers/me_too_helper.rb b/actionpack/test/fixtures/helpers/me_too_helper.rb index ce56042143..8e312e7cd0 100644 --- a/actionpack/test/fixtures/helpers/me_too_helper.rb +++ b/actionpack/test/fixtures/helpers/me_too_helper.rb @@ -1,3 +1,3 @@ module MeTooHelper def me() "me too!" end -end
\ No newline at end of file +end diff --git a/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb b/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb index 7d2326e04d..64aa1a0476 100644 --- a/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb +++ b/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb @@ -2,4 +2,3 @@ module Admin module UsersHelpeR end end - diff --git a/actionpack/test/journey/gtg/builder_test.rb b/actionpack/test/journey/gtg/builder_test.rb index 270bc7d741..5861cd2414 100644 --- a/actionpack/test/journey/gtg/builder_test.rb +++ b/actionpack/test/journey/gtg/builder_test.rb @@ -59,20 +59,20 @@ module ActionDispatch end private - def ast strings - parser = Journey::Parser.new - asts = strings.map { |string| - memo = Object.new - ast = parser.parse string - ast.each { |n| n.memo = memo } - ast - } - Nodes::Or.new asts - end + def ast strings + parser = Journey::Parser.new + asts = strings.map { |string| + memo = Object.new + ast = parser.parse string + ast.each { |n| n.memo = memo } + ast + } + Nodes::Or.new asts + end - def tt strings - Builder.new(ast(strings)).transition_table - end + def tt strings + Builder.new(ast(strings)).transition_table + end end end end diff --git a/actionpack/test/journey/gtg/transition_table_test.rb b/actionpack/test/journey/gtg/transition_table_test.rb index 00be1c2da6..566eb4d186 100644 --- a/actionpack/test/journey/gtg/transition_table_test.rb +++ b/actionpack/test/journey/gtg/transition_table_test.rb @@ -91,24 +91,24 @@ module ActionDispatch end private - def asts paths - parser = Journey::Parser.new - paths.map { |x| - ast = parser.parse x - ast.each { |n| n.memo = ast} - ast - } - end + def asts paths + parser = Journey::Parser.new + paths.map { |x| + ast = parser.parse x + ast.each { |n| n.memo = ast} + ast + } + end - def tt paths - x = asts paths - builder = GTG::Builder.new Nodes::Or.new x - builder.transition_table - end + def tt paths + x = asts paths + builder = GTG::Builder.new Nodes::Or.new x + builder.transition_table + end - def simulator_for paths - GTG::Simulator.new tt(paths) - end + def simulator_for paths + GTG::Simulator.new tt(paths) + end end end end diff --git a/actionpack/test/journey/nfa/transition_table_test.rb b/actionpack/test/journey/nfa/transition_table_test.rb index 81f9501688..c948880c47 100644 --- a/actionpack/test/journey/nfa/transition_table_test.rb +++ b/actionpack/test/journey/nfa/transition_table_test.rb @@ -61,11 +61,11 @@ module ActionDispatch end private - def tt string - ast = @parser.parse string - builder = Builder.new ast - builder.transition_table - end + def tt string + ast = @parser.parse string + builder = Builder.new ast + builder.transition_table + end end end end diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb index 83cd999352..efe7bef5c5 100644 --- a/actionpack/test/journey/router_test.rb +++ b/actionpack/test/journey/router_test.rb @@ -493,41 +493,41 @@ module ActionDispatch private - def get *args - ActiveSupport::Deprecation.silence do - mapper.get(*args) + def get *args + ActiveSupport::Deprecation.silence do + mapper.get(*args) + end end - end - def match *args - ActiveSupport::Deprecation.silence do - mapper.match(*args) + def match *args + ActiveSupport::Deprecation.silence do + mapper.match(*args) + end end - end - def rails_env env, klass = ActionDispatch::Request - klass.new(rack_env(env)) - end - - def rack_env env - { - "rack.version" => [1, 1], - "rack.input" => StringIO.new, - "rack.errors" => StringIO.new, - "rack.multithread" => true, - "rack.multiprocess" => true, - "rack.run_once" => false, - "REQUEST_METHOD" => "GET", - "SERVER_NAME" => "example.org", - "SERVER_PORT" => "80", - "QUERY_STRING" => "", - "PATH_INFO" => "/content", - "rack.url_scheme" => "http", - "HTTPS" => "off", - "SCRIPT_NAME" => "", - "CONTENT_LENGTH" => "0" - }.merge env - end + def rails_env env, klass = ActionDispatch::Request + klass.new(rack_env(env)) + end + + def rack_env env + { + "rack.version" => [1, 1], + "rack.input" => StringIO.new, + "rack.errors" => StringIO.new, + "rack.multithread" => true, + "rack.multiprocess" => true, + "rack.run_once" => false, + "REQUEST_METHOD" => "GET", + "SERVER_NAME" => "example.org", + "SERVER_PORT" => "80", + "QUERY_STRING" => "", + "PATH_INFO" => "/content", + "rack.url_scheme" => "http", + "HTTPS" => "off", + "SCRIPT_NAME" => "", + "CONTENT_LENGTH" => "0" + }.merge env + end end end end |