aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-02-11 18:41:59 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-02-11 18:41:59 +0000
commit91cdd59b12d4101c3dc1130cf0f2b4543a14eb79 (patch)
treea4f8eeb35cf4021cc203c0835412572482f6f090 /activesupport/test
parentb9a9893d2b9bfec83ef2e18cc3103d267369a86a (diff)
downloadrails-91cdd59b12d4101c3dc1130cf0f2b4543a14eb79.tar.gz
rails-91cdd59b12d4101c3dc1130cf0f2b4543a14eb79.tar.bz2
rails-91cdd59b12d4101c3dc1130cf0f2b4543a14eb79.zip
Fix constantize to handle names beginning with '::'. Closes #3803.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/inflector_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index d0d7b0bedd..c513abc967 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -274,7 +274,9 @@ class InflectorTest < Test::Unit::TestCase
def test_constantize
assert_equal Ace::Base::Case, Inflector.constantize("Ace::Base::Case")
+ assert_equal Ace::Base::Case, Inflector.constantize("::Ace::Base::Case")
assert_equal InflectorTest, Inflector.constantize("InflectorTest")
+ assert_equal InflectorTest, Inflector.constantize("::InflectorTest")
assert_raises(NameError) { Inflector.constantize("UnknownClass") }
assert_raises(NameError) { Inflector.constantize("An invalid string") }
end