1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

adds coverage for throwing while autoloading

References #24205.
This commit is contained in:
Xavier Noria 2016-03-15 23:44:40 +01:00
parent d54de0808c
commit 52ce6ece8c
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,3 @@
Throws = 1
throw :t

View file

@ -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