aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Umbach <sam@thinkrelevance.com>2011-12-03 12:58:31 -0500
committerSam Umbach <sam@thinkrelevance.com>2011-12-03 12:58:41 -0500
commit0a485309a03bdf290d3c42186916dac5e900db65 (patch)
tree0bd7450c3f4058ebb3b3d2926e7d3c6bb5908e4d
parent93580f49361210903a4e9cfa34a89da8ddb15815 (diff)
downloadrails-0a485309a03bdf290d3c42186916dac5e900db65.tar.gz
rails-0a485309a03bdf290d3c42186916dac5e900db65.tar.bz2
rails-0a485309a03bdf290d3c42186916dac5e900db65.zip
Test return value of ActiveSupport::Dependencies::Loadable#load
-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 6dc303ea86..94e7e118ff 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -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)