diff options
author | Tom Ward <tom@popdog.net> | 2008-04-29 13:21:51 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-20 11:44:23 +0100 |
commit | ebb642fa3a2b1a4e31abf9610ca634e6bb5d57d3 (patch) | |
tree | d62b969fa48509a4bd8f228950ad9ce4627be518 /activesupport/test | |
parent | 089251581137b041828a7e6dcbf75ecbef55b4a3 (diff) | |
download | rails-ebb642fa3a2b1a4e31abf9610ca634e6bb5d57d3.tar.gz rails-ebb642fa3a2b1a4e31abf9610ca634e6bb5d57d3.tar.bz2 rails-ebb642fa3a2b1a4e31abf9610ca634e6bb5d57d3.zip |
Fix Dependencies watch_frames collection. [#24 state:resolved]
Previously, the code collecting watch_frames could fail leaving
watch_frames defined but nil. The cleanup code checks watch_frames
is defined, but not that it holds a value, raising an undefined method
on NilClass error rather than the original cause. This can make
debugging the underlying cause a total pain.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/dependencies_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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) |