From 6f58b2cfc97d9ac2358600f18b0fabc48fdfc2c6 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 12 Jul 2018 21:29:48 +0900 Subject: Enable `Layout/EmptyLinesAroundBlockBody` to reduce review cost in the future MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We sometimes ask "✂️ extra blank lines" to a contributor in reviews like https://github.com/rails/rails/pull/33337#discussion_r201509738. It is preferable to deal automatically without depending on manpower. --- activerecord/test/cases/arel/insert_manager_test.rb | 2 -- activerecord/test/cases/arel/select_manager_test.rb | 11 ----------- activerecord/test/cases/inheritance_test.rb | 1 - activerecord/test/cases/nested_attributes_test.rb | 1 - activerecord/test/cases/query_cache_test.rb | 1 - activerecord/test/cases/transactions_test.rb | 1 - 6 files changed, 17 deletions(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/arel/insert_manager_test.rb b/activerecord/test/cases/arel/insert_manager_test.rb index ae10ccf56c..2376ad8d37 100644 --- a/activerecord/test/cases/arel/insert_manager_test.rb +++ b/activerecord/test/cases/arel/insert_manager_test.rb @@ -220,7 +220,6 @@ module Arel end describe "select" do - it "accepts a select query in place of a VALUES clause" do table = Table.new :users @@ -238,7 +237,6 @@ module Arel INSERT INTO "users" ("id", "name") (SELECT 1, "aaron") } end - end end end diff --git a/activerecord/test/cases/arel/select_manager_test.rb b/activerecord/test/cases/arel/select_manager_test.rb index f318577b94..6b10d0b612 100644 --- a/activerecord/test/cases/arel/select_manager_test.rb +++ b/activerecord/test/cases/arel/select_manager_test.rb @@ -244,8 +244,6 @@ module Arel @m2 = Arel::SelectManager.new table @m2.project Arel.star @m2.where(table[:age].gt(99)) - - end it "should union two managers" do @@ -266,7 +264,6 @@ module Arel ( SELECT * FROM "users" WHERE "users"."age" < 18 UNION ALL SELECT * FROM "users" WHERE "users"."age" > 99 ) } end - end describe "intersect" do @@ -279,8 +276,6 @@ module Arel @m2 = Arel::SelectManager.new table @m2.project Arel.star @m2.where(table[:age].lt(99)) - - end it "should interect two managers" do @@ -293,7 +288,6 @@ module Arel ( SELECT * FROM "users" WHERE "users"."age" > 18 INTERSECT SELECT * FROM "users" WHERE "users"."age" < 99 ) } end - end describe "except" do @@ -318,7 +312,6 @@ module Arel ( SELECT * FROM "users" WHERE "users"."age" BETWEEN 18 AND 60 EXCEPT SELECT * FROM "users" WHERE "users"."age" BETWEEN 40 AND 99 ) } end - end describe "with" do @@ -647,7 +640,6 @@ module Arel end describe "joins" do - it "returns inner join sql" do table = Table.new :users aliaz = table.alias @@ -1002,7 +994,6 @@ module Arel end describe "update" do - it "creates an update statement" do table = Table.new :users manager = Arel::SelectManager.new @@ -1075,7 +1066,6 @@ module Arel UPDATE "users" SET "id" = 1 WHERE "users"."id" IN (SELECT "users"."id" FROM "users" WHERE "users"."foo" = 10 LIMIT 42) } end - end describe "project" do @@ -1097,7 +1087,6 @@ module Arel manager.project "*" manager.to_sql.must_be_like %{ SELECT * } end - end describe "projections" do diff --git a/activerecord/test/cases/inheritance_test.rb b/activerecord/test/cases/inheritance_test.rb index 4a0ad0442a..3d3189900f 100644 --- a/activerecord/test/cases/inheritance_test.rb +++ b/activerecord/test/cases/inheritance_test.rb @@ -91,7 +91,6 @@ class InheritanceTest < ActiveRecord::TestCase end ActiveSupport::Dependencies.stub(:safe_constantize, proc { raise e }) do - exception = assert_raises NameError do Company.send :compute_type, "InvalidModel" end diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb index 32af90caef..ec01a2965d 100644 --- a/activerecord/test/cases/nested_attributes_test.rb +++ b/activerecord/test/cases/nested_attributes_test.rb @@ -669,7 +669,6 @@ module NestedAttributesOnACollectionAssociationTests def test_should_take_a_hash_with_composite_id_keys_and_assign_the_attributes_to_the_associated_models @child_1.stub(:id, "ABC1X") do @child_2.stub(:id, "ABC2X") do - @pirate.attributes = { association_getter => [ { id: @child_1.id, name: "Grace OMalley" }, diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb index 1c05571f1b..69be091869 100644 --- a/activerecord/test/cases/query_cache_test.rb +++ b/activerecord/test/cases/query_cache_test.rb @@ -482,7 +482,6 @@ class QueryCacheTest < ActiveRecord::TestCase assert_not ActiveRecord::Base.connection.query_cache_enabled }.join }.call({}) - end end diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb index 5b685ca564..46463ac414 100644 --- a/activerecord/test/cases/transactions_test.rb +++ b/activerecord/test/cases/transactions_test.rb @@ -573,7 +573,6 @@ class TransactionTest < ActiveRecord::TestCase assert_called(Topic.connection, :begin_db_transaction) do Topic.connection.stub(:commit_db_transaction, -> { raise("OH NOES") }) do assert_called(Topic.connection, :rollback_db_transaction) do - e = assert_raise RuntimeError do Topic.transaction do # do nothing -- cgit v1.2.3