Add Style/EmptyLinesAroundMethodBody in .rubocop.yml and remove extra empty lines

This commit is contained in:
Ryuta Kamizono 2017-02-12 20:44:15 +09:00
parent 4fed08fa78
commit 16ee3ccc9c
12 changed files with 4 additions and 11 deletions

@ -33,6 +33,10 @@ Style/EmptyLines:
Style/EmptyLinesAroundClassBody: Style/EmptyLinesAroundClassBody:
Enabled: true Enabled: true
# In a regular method definition, no empty lines around the body.
Style/EmptyLinesAroundMethodBody:
Enabled: true
# In a regular module definition, no empty lines around the body. # In a regular module definition, no empty lines around the body.
Style/EmptyLinesAroundModuleBody: Style/EmptyLinesAroundModuleBody:
Enabled: true Enabled: true

@ -810,7 +810,6 @@ def test_test_uploaded_file
new_content_type = "new content_type" new_content_type = "new content_type"
file.content_type = new_content_type file.content_type = new_content_type
assert_equal new_content_type, file.content_type assert_equal new_content_type, file.content_type
end end
def test_fixture_path_is_accessed_from_self_instead_of_active_support_test_case def test_fixture_path_is_accessed_from_self_instead_of_active_support_test_case

@ -161,6 +161,5 @@ def reloader(check = lambda { true })
reloader.check = check reloader.check = check
reloader reloader
end end
end end
end end

@ -4,7 +4,6 @@ class RunnerTest < ActiveSupport::TestCase
test "runner preserves the setting of integration_session" do test "runner preserves the setting of integration_session" do
runner = Class.new do runner = Class.new do
def before_setup def before_setup
end end
end.new end.new

@ -1407,7 +1407,6 @@ def test_select_datetime_with_default_prompt
end end
def test_select_datetime_with_custom_prompt def test_select_datetime_with_custom_prompt
expected = %(<select id="date_first_year" name="date[first][year]">\n) expected = %(<select id="date_first_year" name="date[first][year]">\n)
expected << %(<option value="">Choose year</option>\n<option value="2003" selected="selected">2003</option>\n<option value="2004">2004</option>\n<option value="2005">2005</option>\n) expected << %(<option value="">Choose year</option>\n<option value="2003" selected="selected">2003</option>\n<option value="2004">2004</option>\n<option value="2005">2005</option>\n)
expected << "</select>\n" expected << "</select>\n"

@ -767,7 +767,6 @@ def test_check_box_with_multiple_behavior_and_index
'<input name="post[bar][comment_ids][]" type="hidden" value="0" /><input checked="checked" id="post_bar_comment_ids_3" name="post[bar][comment_ids][]" type="checkbox" value="3" />', '<input name="post[bar][comment_ids][]" type="hidden" value="0" /><input checked="checked" id="post_bar_comment_ids_3" name="post[bar][comment_ids][]" type="checkbox" value="3" />',
check_box("post", "comment_ids", { multiple: true, index: "bar" }, 3) check_box("post", "comment_ids", { multiple: true, index: "bar" }, 3)
) )
end end
def test_checkbox_disabled_disables_hidden_field def test_checkbox_disabled_disables_hidden_field

@ -347,7 +347,6 @@ def test_find_with_uuid
assert_raise ActiveRecord::RecordNotFound do assert_raise ActiveRecord::RecordNotFound do
UuidPost.find(123456) UuidPost.find(123456)
end end
end end
def test_find_by_with_uuid def test_find_by_with_uuid

@ -3,7 +3,6 @@
class SQLite3StatementPoolTest < ActiveRecord::SQLite3TestCase class SQLite3StatementPoolTest < ActiveRecord::SQLite3TestCase
if Process.respond_to?(:fork) if Process.respond_to?(:fork)
def test_cache_is_per_pid def test_cache_is_per_pid
cache = ActiveRecord::ConnectionAdapters::SQLite3Adapter::StatementPool.new(10) cache = ActiveRecord::ConnectionAdapters::SQLite3Adapter::StatementPool.new(10)
cache["foo"] = "bar" cache["foo"] = "bar"
assert_equal "bar", cache["foo"] assert_equal "bar", cache["foo"]

@ -883,7 +883,6 @@ def test_collection_singular_ids_setter_with_string_primary_keys
book.subscriber_ids = [] book.subscriber_ids = []
assert_equal [], book.subscribers.reload assert_equal [], book.subscribers.reload
end end
end end
def test_collection_singular_ids_setter_with_changed_primary_key def test_collection_singular_ids_setter_with_changed_primary_key

@ -552,7 +552,6 @@ def test_file_search_uses_first_in_load_path
assert_equal autoload + "/conflict.rb", ActiveSupport::Dependencies.search_for_file("conflict") assert_equal autoload + "/conflict.rb", ActiveSupport::Dependencies.search_for_file("conflict")
end end
end end
def test_custom_const_missing_should_work def test_custom_const_missing_should_work

@ -664,7 +664,6 @@ def test_should_compute_grapheme_length
end end
def test_tidy_bytes_should_tidy_bytes def test_tidy_bytes_should_tidy_bytes
single_byte_cases = { single_byte_cases = {
"\x21" => "!", # Valid ASCII byte, low "\x21" => "!", # Valid ASCII byte, low
"\x41" => "A", # Valid ASCII byte, mid "\x41" => "A", # Valid ASCII byte, mid

@ -661,7 +661,6 @@ def has_migrations?
end end
def self.find_root_with_flag(flag, root_path, default = nil) #:nodoc: def self.find_root_with_flag(flag, root_path, default = nil) #:nodoc:
while root_path && File.directory?(root_path) && !File.exist?("#{root_path}/#{flag}") while root_path && File.directory?(root_path) && !File.exist?("#{root_path}/#{flag}")
parent = File.dirname(root_path) parent = File.dirname(root_path)
root_path = parent != root_path && parent root_path = parent != root_path && parent