diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/dependencies/raises_exception.rb | 2 | ||||
-rw-r--r-- | activesupport/test/dependencies_test.rb | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/activesupport/test/dependencies/raises_exception.rb b/activesupport/test/dependencies/raises_exception.rb index 69750eee72..dd745ac20e 100644 --- a/activesupport/test/dependencies/raises_exception.rb +++ b/activesupport/test/dependencies/raises_exception.rb @@ -1,3 +1,3 @@ $raises_exception_load_count += 1 -raise 'Loading me failed, so do not add to loaded or history.' +raise Exception, 'Loading me failed, so do not add to loaded or history.' $raises_exception_load_count += 1 diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index f969a30891..8b74bd4b93 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -51,7 +51,7 @@ class DependenciesTest < Test::Unit::TestCase $raises_exception_load_count = 0 5.times do |count| - assert_raises(RuntimeError) { require_dependency filename } + assert_raises(Exception) { require_dependency filename } assert_equal count + 1, $raises_exception_load_count assert !Dependencies.loaded.include?(filename) @@ -387,4 +387,12 @@ class DependenciesTest < Test::Unit::TestCase end end + def test_nested_load_error_isnt_rescued + with_loading 'dependencies' do + assert_raises(MissingSourceFile) do + RequiresNonexistent1 + end + end + end + end |