Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Privatize unneededly protected methods in Active Record tests
  • Loading branch information
amatsuda committed Dec 23, 2016
1 parent 79c17a2 commit fce62f1
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion activerecord/test/cases/adapters/mysql2/connection_test.rb
Expand Up @@ -186,7 +186,7 @@ def test_release_non_existent_advisory_lock
"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
Expand Down
Expand Up @@ -245,7 +245,7 @@ def test_release_non_existent_advisory_lock
end
end

protected
private

def with_warning_suppression
log_level = @connection.client_min_messages
Expand Down
Expand Up @@ -89,7 +89,7 @@ class Sample < ActiveRecord::Base
end
end

protected
private

def with_warning_suppression
log_level = ActiveRecord::Base.connection.client_min_messages
Expand Down
Expand Up @@ -75,7 +75,7 @@ def test_copy_table_with_binary_column
test_copy_table "binaries", "binaries2"
end

protected
private
def copy_table(from, to, options = {})
@connection.copy_table(from, to, { temporary: true }.merge(options))
end
Expand Down
Expand Up @@ -12,7 +12,7 @@ module Remembered

included do
after_create :remember
protected
private
def remember; self.class.remembered << self; end
end

Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/finder_test.rb
Expand Up @@ -1220,7 +1220,7 @@ def test_finder_with_offset_string
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
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/locking_test.rb
Expand Up @@ -579,7 +579,7 @@ def test_no_locks_no_wait
assert first.end > second.end
end

protected
private

def duel(zzz = 5)
t0, t1, t2, t3 = nil, nil, nil, nil
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/migration_test.rb
Expand Up @@ -705,7 +705,7 @@ def migrate(x)
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
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/models/company_in_module.rb
Expand Up @@ -88,7 +88,7 @@ class Account < ActiveRecord::Base

validate :check_empty_credit_limit

protected
private

def check_empty_credit_limit
errors.add("credit_card", :blank) if credit_card.blank?
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/models/subject.rb
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/models/topic.rb
Expand Up @@ -73,7 +73,7 @@ def approved=(val)
write_attribute(:approved, val)
end

protected
private

def default_written_on
self.written_on = Time.now unless attribute_present?("written_on")
Expand Down

0 comments on commit fce62f1

Please sign in to comment.