diff options
author | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-08-10 14:56:03 +0800 |
---|---|---|
committer | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-09-02 00:41:00 +0800 |
commit | 6e0f273dfd4dc30ec4fa1c6db1079f5fd3f717ff (patch) | |
tree | 6760eb4e8e150e0084d782dafb32f4791aa1e3cd /activesupport/test/testing | |
parent | fcbdac7e82725c388bf5adf56a9a9a16d4efdbe0 (diff) | |
download | rails-6e0f273dfd4dc30ec4fa1c6db1079f5fd3f717ff.tar.gz rails-6e0f273dfd4dc30ec4fa1c6db1079f5fd3f717ff.tar.bz2 rails-6e0f273dfd4dc30ec4fa1c6db1079f5fd3f717ff.zip |
Use `safe_constantize`.
Fixes https://github.com/rails/rails/issues/9933.
Diffstat (limited to 'activesupport/test/testing')
-rw-r--r-- | activesupport/test/testing/constant_lookup_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 |