From 91cdd59b12d4101c3dc1130cf0f2b4543a14eb79 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Sat, 11 Feb 2006 18:41:59 +0000 Subject: 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 --- activesupport/test/inflector_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activesupport/test') 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 -- cgit v1.2.3