aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/inflector_test.rb
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2005-11-16 00:56:16 +0000
committerNicholas Seckar <nseckar@gmail.com>2005-11-16 00:56:16 +0000
commit1cc8ab865fb0b36df1d202ea4d08952d2881d347 (patch)
tree2773c3f929b03094a9d08b3a07d676e60e21b0e4 /activesupport/test/inflector_test.rb
parentc98011bc32ac892f38bbda15b485c87a35795bba (diff)
downloadrails-1cc8ab865fb0b36df1d202ea4d08952d2881d347.tar.gz
rails-1cc8ab865fb0b36df1d202ea4d08952d2881d347.tar.bz2
rails-1cc8ab865fb0b36df1d202ea4d08952d2881d347.zip
Change Inflector#constantize to use eval instead of const_get
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3049 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/inflector_test.rb')
-rw-r--r--activesupport/test/inflector_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index 995871f826..d92b4a76a8 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -276,6 +276,11 @@ class InflectorTest < Test::Unit::TestCase
assert_equal Ace::Base::Case, Inflector.constantize("Ace::Base::Case")
assert_equal InflectorTest, Inflector.constantize("InflectorTest")
assert_raises(NameError) { Inflector.constantize("UnknownClass") }
+ assert_raises(NameError) { Inflector.constantize("An invalid string") }
+ end
+
+ def test_constantize_doesnt_look_in_parent
+ assert_raises(NameError) { Inflector.constantize("Ace::Base::InflectorTest") }
end
def test_ordinal