Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test return value of ActiveSupport::Dependencies::Loadable#load

  • Loading branch information...
commit 9effced47fff7cf78734bba64bc95735db29ba0a 1 parent dea2e9c
@sumbach sumbach authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 activesupport/test/dependencies_test.rb
View
16 activesupport/test/dependencies_test.rb
@@ -306,6 +306,22 @@ def test_require_returns_false_when_file_already_required
$:.replace(original_path)
end
+ def test_load_returns_true_when_file_found
+ path = File.expand_path("../autoloading_fixtures/load_path", __FILE__)
+ original_path = $:.dup
+ original_features = $".dup
+ $:.push(path)
+
+ with_loading('autoloading_fixtures/load_path') do
+ assert_equal true, load('loaded_constant.rb')
+ assert_equal true, load('loaded_constant.rb')
+ end
+ ensure
+ remove_constants(:LoadedConstant)
+ $".replace(original_features)
+ $:.replace(original_path)
+ end
+
def failing_test_access_thru_and_upwards_fails
with_autoloading_fixtures do
assert ! defined?(ModuleFolder)
Please sign in to comment.
Something went wrong with that request. Please try again.