From b081948bb3e1a6874f133140bf07e7fb9d3359d9 Mon Sep 17 00:00:00 2001 From: Kabari Hendrick Date: Sun, 14 Mar 2010 01:33:45 -0600 Subject: fixing inconsistency with cattr_reader and matter_reader [#4172 state:resolved] Signed-off-by: wycats --- activesupport/test/core_ext/class/attribute_accessor_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activesupport/test/core_ext/class/attribute_accessor_test.rb') diff --git a/activesupport/test/core_ext/class/attribute_accessor_test.rb b/activesupport/test/core_ext/class/attribute_accessor_test.rb index 2214ba9894..0f579d12e5 100644 --- a/activesupport/test/core_ext/class/attribute_accessor_test.rb +++ b/activesupport/test/core_ext/class/attribute_accessor_test.rb @@ -5,7 +5,8 @@ class ClassAttributeAccessorTest < Test::Unit::TestCase def setup @class = Class.new do cattr_accessor :foo - cattr_accessor :bar, :instance_writer => false + cattr_accessor :bar, :instance_writer => false + cattr_reader :shaq, :instance_reader => false end @object = @class.new end @@ -29,4 +30,9 @@ class ClassAttributeAccessorTest < Test::Unit::TestCase assert @object.respond_to?(:bar) assert !@object.respond_to?(:bar=) end + + def test_should_not_create_instance_reader + assert @class.respond_to?(:shaq) + assert !@object.respond_to?(:shaq) + end end -- cgit v1.2.3