aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/module/attribute_accessor_test.rb
diff options
context:
space:
mode:
authorKabari Hendrick <kabari@gmail.com>2010-03-14 01:33:45 -0600
committerwycats <wycats@gmail.com>2010-03-27 02:07:04 -0700
commitb081948bb3e1a6874f133140bf07e7fb9d3359d9 (patch)
treeba4ad456cf94d4e563c539f2249f5a4555836fea /activesupport/test/core_ext/module/attribute_accessor_test.rb
parent334983eca042b5016d3d79d7ed5761b60ba871ed (diff)
downloadrails-b081948bb3e1a6874f133140bf07e7fb9d3359d9.tar.gz
rails-b081948bb3e1a6874f133140bf07e7fb9d3359d9.tar.bz2
rails-b081948bb3e1a6874f133140bf07e7fb9d3359d9.zip
fixing inconsistency with cattr_reader and matter_reader [#4172 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
Diffstat (limited to 'activesupport/test/core_ext/module/attribute_accessor_test.rb')
-rw-r--r--activesupport/test/core_ext/module/attribute_accessor_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/module/attribute_accessor_test.rb b/activesupport/test/core_ext/module/attribute_accessor_test.rb
index bd9461e62c..263e78feaa 100644
--- a/activesupport/test/core_ext/module/attribute_accessor_test.rb
+++ b/activesupport/test/core_ext/module/attribute_accessor_test.rb
@@ -6,6 +6,7 @@ class ModuleAttributeAccessorTest < Test::Unit::TestCase
m = @module = Module.new do
mattr_accessor :foo
mattr_accessor :bar, :instance_writer => false
+ mattr_reader :shaq, :instance_reader => false
end
@class = Class.new
@class.instance_eval { include m }
@@ -31,4 +32,9 @@ class ModuleAttributeAccessorTest < Test::Unit::TestCase
assert @object.respond_to?(:bar)
assert !@object.respond_to?(:bar=)
end
+
+ def test_should_not_create_instance_reader
+ assert @module.respond_to?(:shaq)
+ assert !@object.respond_to?(:shaq)
+ end
end