From a107103e85a2cc294faedddbb44707fd2bc2e206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 28 Oct 2009 09:50:18 -0200 Subject: Allow :instance_reader to be given to superclass_delegating_accessor as well. --- activesupport/test/core_ext/class/delegating_attributes_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/test/core_ext/class') 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 -- cgit v1.2.3