aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/helper_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-22 13:44:16 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-22 13:44:16 +0000
commita04b1f3d8a54aaec988c264267cf9f2c2340f275 (patch)
tree024a0ed444df4dd0f3414b789b1018f9bd20ebad /actionpack/test/controller/helper_test.rb
parentf408fcd610c83d29effba92db29c35f7653187b6 (diff)
downloadrails-a04b1f3d8a54aaec988c264267cf9f2c2340f275.tar.gz
rails-a04b1f3d8a54aaec988c264267cf9f2c2340f275.tar.bz2
rails-a04b1f3d8a54aaec988c264267cf9f2c2340f275.zip
Added more informative exception when using helper :some_helper and the helper requires another file that fails, you'll get an error message tells you what file actually failed to load, rather than falling back on assuming it was the helper file itself #346 [dblack]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@250 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/helper_test.rb')
-rw-r--r--actionpack/test/controller/helper_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb
index 9d1da53241..b824e40125 100644
--- a/actionpack/test/controller/helper_test.rb
+++ b/actionpack/test/controller/helper_test.rb
@@ -70,6 +70,12 @@ class HelperTest < Test::Unit::TestCase
assert_raise(LoadError) { @controller_class.helper :missing }
end
+ def test_declare_missing_file_from_helper
+ require 'broken_helper'
+ rescue LoadError => e
+ assert_nil /\bbroken_helper\b/.match(e.to_s)[1]
+ end
+
def test_helper_block
assert_nothing_raised {
@controller_class.helper { def block_helper_method; end }
@@ -107,4 +113,4 @@ class HelperTest < Test::Unit::TestCase
self.class.const_set('TestHelper', helper_module)
$VERBOSE = old_verbose
end
-end \ No newline at end of file
+end