diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 6b9fbd3..408a2c7 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -8,6 +8,15 @@ module Ace end end +class Alpha + class Beta + end +end + +class Gamma < Alpha +end + + class InflectorTest < Test::Unit::TestCase include InflectorTestCases @@ -167,6 +176,7 @@ class InflectorTest < Test::Unit::TestCase assert_nothing_raised { assert_equal Ace::Base::Case, ActiveSupport::Inflector.constantize("::Ace::Base::Case") } assert_nothing_raised { assert_equal InflectorTest, ActiveSupport::Inflector.constantize("InflectorTest") } assert_nothing_raised { assert_equal InflectorTest, ActiveSupport::Inflector.constantize("::InflectorTest") } + assert_nothing_raised { assert_equal Gamma::Beta, ActiveSupport::Inflector.constantize("Gamma::Beta") } assert_raise(NameError) { ActiveSupport::Inflector.constantize("UnknownClass") } assert_raise(NameError) { ActiveSupport::Inflector.constantize("An invalid string") } assert_raise(NameError) { ActiveSupport::Inflector.constantize("InvalidClass\n") }