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

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

@ -269,6 +269,17 @@ def test_nested_class_can_access_sibling
remove_constants(:ModuleFolder) remove_constants(:ModuleFolder)
end 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 def test_doesnt_break_normal_require
path = File.expand_path("../autoloading_fixtures/load_path", __FILE__) path = File.expand_path("../autoloading_fixtures/load_path", __FILE__)
original_path = $:.dup original_path = $:.dup