aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/class
diff options
context:
space:
mode:
authorHrvoje Šimić <shime.ferovac@gmail.com>2013-04-17 16:12:21 +0200
committerHrvoje Šimić <shime.ferovac@gmail.com>2013-04-17 16:12:21 +0200
commit4037fc83c1ad6655569d630e2c909d846a607705 (patch)
tree5d8a95bd71ebd0219313fe679e63c5d759284ce0 /activesupport/test/core_ext/class
parent46287d6ada3a6b0ab9a7eb371297bf18fb8b74bd (diff)
downloadrails-4037fc83c1ad6655569d630e2c909d846a607705.tar.gz
rails-4037fc83c1ad6655569d630e2c909d846a607705.tar.bz2
rails-4037fc83c1ad6655569d630e2c909d846a607705.zip
more descriptive NameError's messages for class attributes
Diffstat (limited to 'activesupport/test/core_ext/class')
-rw-r--r--activesupport/test/core_ext/class/attribute_accessor_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/test/core_ext/class/attribute_accessor_test.rb b/activesupport/test/core_ext/class/attribute_accessor_test.rb
index 8d827f054e..0d5f39a72b 100644
--- a/activesupport/test/core_ext/class/attribute_accessor_test.rb
+++ b/activesupport/test/core_ext/class/attribute_accessor_test.rb
@@ -44,16 +44,18 @@ class ClassAttributeAccessorTest < ActiveSupport::TestCase
end
def test_should_raise_name_error_if_attribute_name_is_invalid
- assert_raises NameError do
+ exception = assert_raises NameError do
Class.new do
- cattr_reader "invalid attribute name"
+ cattr_reader "1nvalid"
end
end
+ assert_equal "invalid class attribute name: 1nvalid", exception.message
- assert_raises NameError do
+ exception = assert_raises NameError do
Class.new do
- cattr_writer "invalid attribute name"
+ cattr_writer "1nvalid"
end
end
+ assert_equal "invalid class attribute name: 1nvalid", exception.message
end
end