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

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

View file

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

View file

@ -269,6 +269,15 @@ class DependenciesTest < ActiveSupport::TestCase
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