diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2011-06-13 18:47:10 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2011-06-13 18:56:06 +0200 |
commit | b12c2e4ebb85170467ac250219557d631c842d8d (patch) | |
tree | c00f317cd91c3f4631e7471b4de6d1e7c94f68d9 /activesupport/test/core_ext/class | |
parent | 276618c6526587231cdcb783cc104e89e6458c56 (diff) | |
download | rails-b12c2e4ebb85170467ac250219557d631c842d8d.tar.gz rails-b12c2e4ebb85170467ac250219557d631c842d8d.tar.bz2 rails-b12c2e4ebb85170467ac250219557d631c842d8d.zip |
Added instance_accessor: false as an option to Class#cattr_accessor and friends [DHH]
Diffstat (limited to 'activesupport/test/core_ext/class')
-rw-r--r-- | activesupport/test/core_ext/class/attribute_accessor_test.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/activesupport/test/core_ext/class/attribute_accessor_test.rb b/activesupport/test/core_ext/class/attribute_accessor_test.rb index 456f4b7948..6b50f8db37 100644 --- a/activesupport/test/core_ext/class/attribute_accessor_test.rb +++ b/activesupport/test/core_ext/class/attribute_accessor_test.rb @@ -5,8 +5,9 @@ class ClassAttributeAccessorTest < Test::Unit::TestCase def setup @class = Class.new do cattr_accessor :foo - cattr_accessor :bar, :instance_writer => false - cattr_reader :shaq, :instance_reader => false + cattr_accessor :bar, :instance_writer => false + cattr_reader :shaq, :instance_reader => false + cattr_accessor :camp, :instance_accessor => false end @object = @class.new end @@ -35,4 +36,10 @@ class ClassAttributeAccessorTest < Test::Unit::TestCase assert_respond_to @class, :shaq assert !@object.respond_to?(:shaq) end + + def test_should_not_create_instance_accessors + assert_respond_to @class, :camp + assert !@object.respond_to?(:camp) + assert !@object.respond_to?(:camp=) + end end |