diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-06 04:52:59 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-06 04:52:59 +0900 |
commit | a925295658457571d3474cabf1117f4aa85a1869 (patch) | |
tree | f9b91953fc3d0e8b5ed464e3b970ad4b7d69614c /activerecord/test | |
parent | 8b69e32412cc2867b5fdd9a33cf4e4e759057e95 (diff) | |
download | rails-a925295658457571d3474cabf1117f4aa85a1869.tar.gz rails-a925295658457571d3474cabf1117f4aa85a1869.tar.bz2 rails-a925295658457571d3474cabf1117f4aa85a1869.zip |
Remove unused `DelegationTest#call_method`
`DelegationTest#call_method` is no longer used since 9d79334a.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relation/delegation_test.rb | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/activerecord/test/cases/relation/delegation_test.rb b/activerecord/test/cases/relation/delegation_test.rb index 8cb7b82015..cb6e4d76d3 100644 --- a/activerecord/test/cases/relation/delegation_test.rb +++ b/activerecord/test/cases/relation/delegation_test.rb @@ -3,29 +3,7 @@ require "models/post" require "models/comment" module ActiveRecord - class DelegationTest < ActiveRecord::TestCase - fixtures :posts - - def call_method(target, method) - method_arity = target.to_a.method(method).arity - - if method_arity.zero? - target.public_send(method) - elsif method_arity < 0 - if method == :shuffle! - target.public_send(method) - else - target.public_send(method, 1) - end - elsif method_arity == 1 - target.public_send(method, 1) - else - raise NotImplementedError - end - end - end - - module DelegationWhitelistBlacklistTests + module DelegationWhitelistTests ARRAY_DELEGATES = [ :+, :-, :|, :&, :[], :shuffle, :all?, :collect, :compact, :detect, :each, :each_cons, :each_with_index, @@ -43,16 +21,18 @@ module ActiveRecord end end - class DelegationAssociationTest < DelegationTest - include DelegationWhitelistBlacklistTests + class DelegationAssociationTest < ActiveRecord::TestCase + include DelegationWhitelistTests + + fixtures :posts def target Post.first.comments end end - class DelegationRelationTest < DelegationTest - include DelegationWhitelistBlacklistTests + class DelegationRelationTest < ActiveRecord::TestCase + include DelegationWhitelistTests fixtures :comments |