1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Privatize unneededly protected methods in Active Record tests

This commit is contained in:
Akira Matsuda 2016-12-23 15:51:03 +09:00
parent 79c17a2d91
commit fce62f1f83
11 changed files with 11 additions and 11 deletions

View file

@ -186,7 +186,7 @@ class Mysql2ConnectionTest < ActiveRecord::Mysql2TestCase
"expected release_advisory_lock to return false when there was no lock to release"
end
protected
private
def test_lock_free(lock_name)
@connection.select_value("SELECT IS_FREE_LOCK(#{@connection.quote(lock_name)})") == 1

View file

@ -245,7 +245,7 @@ module ActiveRecord
end
end
protected
private
def with_warning_suppression
log_level = @connection.client_min_messages

View file

@ -89,7 +89,7 @@ module ActiveRecord
end
end
protected
private
def with_warning_suppression
log_level = ActiveRecord::Base.connection.client_min_messages

View file

@ -75,7 +75,7 @@ class CopyTableTest < ActiveRecord::SQLite3TestCase
test_copy_table "binaries", "binaries2"
end
protected
private
def copy_table(from, to, options = {})
@connection.copy_table(from, to, { temporary: true }.merge(options))
end

View file

@ -12,7 +12,7 @@ module Remembered
included do
after_create :remember
protected
private
def remember; self.class.remembered << self; end
end

View file

@ -1220,7 +1220,7 @@ class FinderTest < ActiveRecord::TestCase
assert_equal tyre2, zyke.tyres.custom_find_by(id: tyre2.id)
end
protected
private
def table_with_custom_primary_key
yield(Class.new(Toy) do
def self.name

View file

@ -579,7 +579,7 @@ unless in_memory_db?
assert first.end > second.end
end
protected
private
def duel(zzz = 5)
t0, t1, t2, t3 = nil, nil, nil, nil

View file

@ -705,7 +705,7 @@ class MigrationTest < ActiveRecord::TestCase
end
end
protected
private
# This is needed to isolate class_attribute assignments like `table_name_prefix`
# for each test case.
def new_isolated_reminder_class

View file

@ -88,7 +88,7 @@ module MyApplication
validate :check_empty_credit_limit
protected
private
def check_empty_credit_limit
errors.add("credit_card", :blank) if credit_card.blank?

View file

@ -5,7 +5,7 @@ class Subject < ActiveRecord::Base
# as otherwise synonym test was failing
after_initialize :set_email_address
protected
private
def set_email_address
unless persisted?
self.author_email_address = "test@test.com"

View file

@ -73,7 +73,7 @@ class Topic < ActiveRecord::Base
write_attribute(:approved, val)
end
protected
private
def default_written_on
self.written_on = Time.now unless attribute_present?("written_on")