aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-10-28 09:50:18 -0200
committerYehuda Katz <wycats@gmail.com>2009-11-01 02:23:49 +0100
commita107103e85a2cc294faedddbb44707fd2bc2e206 (patch)
tree55c59782a166caa9345c3f30a04c298d2fdf7303 /activesupport/test/core_ext
parent2aafdc839600240a55cea06c960d0a2a7f63016d (diff)
downloadrails-a107103e85a2cc294faedddbb44707fd2bc2e206.tar.gz
rails-a107103e85a2cc294faedddbb44707fd2bc2e206.tar.bz2
rails-a107103e85a2cc294faedddbb44707fd2bc2e206.zip
Allow :instance_reader to be given to superclass_delegating_accessor as well.
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/class/delegating_attributes_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/class/delegating_attributes_test.rb b/activesupport/test/core_ext/class/delegating_attributes_test.rb
index b51d68551d..beb55ba17e 100644
--- a/activesupport/test/core_ext/class/delegating_attributes_test.rb
+++ b/activesupport/test/core_ext/class/delegating_attributes_test.rb
@@ -52,6 +52,13 @@ class DelegatingAttributesTest < Test::Unit::TestCase
assert !single_class.public_instance_methods.map(&:to_s).include?("both=")
end
+ def test_simple_accessor_declaration_with_instance_reader_false
+ single_class.superclass_delegating_accessor :no_instance_reader, :instance_reader => false
+ assert single_class.respond_to?(:no_instance_reader)
+ assert single_class.respond_to?(:no_instance_reader=)
+ assert !single_class.public_instance_methods.map(&:to_s).include?("no_instance_reader")
+ end
+
def test_working_with_simple_attributes
single_class.superclass_delegating_accessor :both