aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/inflector_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/inflector_test.rb')
-rw-r--r--activesupport/test/inflector_test.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index 16ee50f8fb..b0155d36bc 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -120,8 +120,14 @@ class InflectorTest < Test::Unit::TestCase
assert_raises(NameError) { Inflector.constantize("InvalidClass\n") }
end
- def test_constantize_doesnt_look_in_parent
- assert_raises(NameError) { Inflector.constantize("Ace::Base::InflectorTest") }
+ if RUBY_VERSION < '1.9.0'
+ def test_constantize_does_lexical_lookup
+ assert_raises(NameError) { Inflector.constantize("Ace::Base::InflectorTest") }
+ end
+ else
+ def test_constantize_does_dynamic_lookup
+ assert_equal self.class, Inflector.constantize("Ace::Base::InflectorTest")
+ end
end
def test_ordinal