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

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

This commit is contained in:
Sam Umbach 2011-12-03 12:58:31 -05:00
parent 93580f4936
commit 0a485309a0

View file

@ -305,6 +305,22 @@ class DependenciesTest < Test::Unit::TestCase
$:.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)