diff options
author | Xavier Noria <fxn@hashref.com> | 2016-03-15 23:44:40 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-03-15 23:46:05 +0100 |
commit | 52ce6ece8c8f74064bb64e0a0b1ddd83092718e1 (patch) | |
tree | 30e02e89d15d66208421e06d881b44ddfce79ef0 /activesupport/test/dependencies_test.rb | |
parent | d54de0808c05c3f7c70dee8ab0111a94c8f90d00 (diff) | |
download | rails-52ce6ece8c8f74064bb64e0a0b1ddd83092718e1.tar.gz rails-52ce6ece8c8f74064bb64e0a0b1ddd83092718e1.tar.bz2 rails-52ce6ece8c8f74064bb64e0a0b1ddd83092718e1.zip |
adds coverage for throwing while autoloading
References #24205.
Diffstat (limited to 'activesupport/test/dependencies_test.rb')
-rw-r--r-- | activesupport/test/dependencies_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index b7a5747f1b..1f9f8aebd3 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -269,6 +269,17 @@ class DependenciesTest < ActiveSupport::TestCase remove_constants(:ModuleFolder) end + def test_throwing_removes_autoloaded_constants + with_autoloading_fixtures do + catch :t do + Throws + end + assert !Object.const_defined?(:Throws) + end + ensure + remove_constants(:Throws) + end + def test_doesnt_break_normal_require path = File.expand_path("../autoloading_fixtures/load_path", __FILE__) original_path = $:.dup |