aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/test/dependencies_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index 94e7e118ff..3a7922d219 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -305,6 +305,14 @@ class DependenciesTest < Test::Unit::TestCase
$:.replace(original_path)
end
+ def test_require_raises_load_error_when_file_not_found
+ with_loading do
+ assert_raise(LoadError) { require 'this_file_dont_exist_dude' }
+ end
+ ensure
+ remove_constants(:LoadedConstant)
+ end
+
def test_load_returns_true_when_file_found
path = File.expand_path("../autoloading_fixtures/load_path", __FILE__)
original_path = $:.dup
@@ -321,6 +329,14 @@ class DependenciesTest < Test::Unit::TestCase
$:.replace(original_path)
end
+ def test_load_raises_load_error_when_file_not_found
+ with_loading do
+ assert_raise(LoadError) { load 'this_file_dont_exist_dude.rb' }
+ end
+ ensure
+ remove_constants(:LoadedConstant)
+ end
+
def failing_test_access_thru_and_upwards_fails
with_autoloading_fixtures do
assert ! defined?(ModuleFolder)