diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-05-20 15:05:51 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-20 15:05:51 +0100 |
commit | babd1e57e697dca47c2ab8cd8c63486f2f1ea2f9 (patch) | |
tree | cc7819c30640cbdd7196191985077848e512d7ef /activesupport | |
parent | 02674a892b992132707cc923e2ab45c11ca5d418 (diff) | |
parent | 73c59638549686fccc749ffd3ac53cb533c5fd61 (diff) | |
download | rails-babd1e57e697dca47c2ab8cd8c63486f2f1ea2f9.tar.gz rails-babd1e57e697dca47c2ab8cd8c63486f2f1ea2f9.tar.bz2 rails-babd1e57e697dca47c2ab8cd8c63486f2f1ea2f9.zip |
Merge commit 'mainstream/master'
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 2 | ||||
-rw-r--r-- | activesupport/test/dependencies_test.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index eaba46dd9c..25225d5615 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -384,7 +384,7 @@ module Dependencies #:nodoc: return new_constants ensure # Remove the stack frames that we added. - if defined?(watch_frames) && ! watch_frames.empty? + if defined?(watch_frames) && ! watch_frames.blank? frame_ids = watch_frames.collect(&:object_id) constant_watch_stack.delete_if do |watch_frame| frame_ids.include? watch_frame.object_id diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index 9e98e764fd..1e19e12da9 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -584,6 +584,12 @@ class DependenciesTest < Test::Unit::TestCase assert_equal [], m end + def test_new_constants_in_with_illegal_module_name_raises_correct_error + assert_raises(NameError) do + Dependencies.new_constants_in("Illegal-Name") {} + end + end + def test_file_with_multiple_constants_and_require_dependency with_loading 'autoloading_fixtures' do assert ! defined?(MultipleConstantFile) |