From 6e0f273dfd4dc30ec4fa1c6db1079f5fd3f717ff Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Sun, 10 Aug 2014 14:56:03 +0800 Subject: Use `safe_constantize`. Fixes https://github.com/rails/rails/issues/9933. --- activesupport/test/testing/constant_lookup_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activesupport/test/testing') diff --git a/activesupport/test/testing/constant_lookup_test.rb b/activesupport/test/testing/constant_lookup_test.rb index 71a9561189..0f16419c8b 100644 --- a/activesupport/test/testing/constant_lookup_test.rb +++ b/activesupport/test/testing/constant_lookup_test.rb @@ -65,4 +65,12 @@ class ConstantLookupTest < ActiveSupport::TestCase } } end + + def test_does_not_swallow_exception_on_no_name_error_within_constant + assert_raises(NameError) do + with_autoloading_fixtures do + self.class.determine_constant_from_test_name('RaisesNameError') + end + end + end end -- cgit v1.2.3