adds coverage for raising while autoloading

This commit is contained in:
Xavier Noria 2016-03-16 07:40:11 +01:00
parent 52ce6ece8c
commit 4efb3608f0
2 changed files with 12 additions and 0 deletions

@ -0,0 +1,3 @@
RaisesArbitraryException = 1
raise Exception, 'arbitray exception message'

@ -269,6 +269,15 @@ def test_nested_class_can_access_sibling
remove_constants(:ModuleFolder)
end
def test_raising_removes_autoloaded_constants
with_autoloading_fixtures do
assert_raises(Exception, 'arbitray exception message') { RaisesArbitraryException }
assert !Object.const_defined?(:RaisesArbitraryException)
end
ensure
remove_constants(:RaisesArbitraryException)
end
def test_throwing_removes_autoloaded_constants
with_autoloading_fixtures do
catch :t do