diff options
author | Carl Lerche <carllerche@mac.com> | 2010-04-01 17:18:24 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-04-01 17:18:42 -0700 |
commit | ab281f511ccb3893ea077fe8a7bb78cdd2db0885 (patch) | |
tree | bd8f699175141c682f6d7489e543e7ad79d59159 /activesupport/test/core_ext/class | |
parent | f0364d87f03d58312bcab1b2f17b5b56b6c72653 (diff) | |
download | rails-ab281f511ccb3893ea077fe8a7bb78cdd2db0885.tar.gz rails-ab281f511ccb3893ea077fe8a7bb78cdd2db0885.tar.bz2 rails-ab281f511ccb3893ea077fe8a7bb78cdd2db0885.zip |
Fix class_attribute so that it works with singleton classes.
Diffstat (limited to 'activesupport/test/core_ext/class')
-rw-r--r-- | activesupport/test/core_ext/class/attribute_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/class/attribute_test.rb b/activesupport/test/core_ext/class/attribute_test.rb index 06b4cf075f..24aa5c0eba 100644 --- a/activesupport/test/core_ext/class/attribute_test.rb +++ b/activesupport/test/core_ext/class/attribute_test.rb @@ -59,4 +59,10 @@ class ClassAttributeTest < ActiveSupport::TestCase object = Class.new { class_attribute :setting, :instance_writer => false }.new assert_raise(NoMethodError) { object.setting = 'boom' } end + + test 'works well with singleton classes' do + object = @klass.new + object.singleton_class.setting = 'foo' + assert_equal 'foo', object.setting + end end |