diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-19 07:39:13 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-19 07:39:13 -0800 |
commit | 21fe17a067cef34b77b60c127d947f1ec537f9ff (patch) | |
tree | 35e68594e2fbf33b190a64f88bc8dc6db6d017ab /activesupport/test | |
parent | cc1f0b4c2df0fa12ad6f3fd3b496e72e6f428e9c (diff) | |
parent | d4197bc4a2320561891a7ae426c89c921c38d8c6 (diff) | |
download | rails-21fe17a067cef34b77b60c127d947f1ec537f9ff.tar.gz rails-21fe17a067cef34b77b60c127d947f1ec537f9ff.tar.bz2 rails-21fe17a067cef34b77b60c127d947f1ec537f9ff.zip |
Merge pull request #13401 from akshay-vishnoi/refactor
Prevent creation of instance methods when `instance_reader = false`, Grammar checks, Conditional statements combined
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/class/delegating_attributes_test.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/test/core_ext/class/delegating_attributes_test.rb b/activesupport/test/core_ext/class/delegating_attributes_test.rb index 148f82946c..0e0742d147 100644 --- a/activesupport/test/core_ext/class/delegating_attributes_test.rb +++ b/activesupport/test/core_ext/class/delegating_attributes_test.rb @@ -39,10 +39,13 @@ class DelegatingAttributesTest < ActiveSupport::TestCase end def test_simple_accessor_declaration_with_instance_reader_false + _instance_methods = single_class.public_instance_methods single_class.superclass_delegating_accessor :no_instance_reader, :instance_reader => false assert_respond_to single_class, :no_instance_reader assert_respond_to single_class, :no_instance_reader= - assert !single_class.public_instance_methods.map(&:to_s).include?("no_instance_reader") + assert !_instance_methods.include?(:no_instance_reader) + assert !_instance_methods.include?(:no_instance_reader?) + assert !_instance_methods.include?(:_no_instance_reader) end def test_working_with_simple_attributes |