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:
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 @@ 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
|
||||
|
|
Loading…
Reference in a new issue