aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-07-15 20:39:36 +0200
committerMichael Koziarski <michael@koziarski.com>2008-07-15 20:39:36 +0200
commit24a8ae4e08fcd15a8c3792990d1d0981d004d339 (patch)
tree95d3df24c528fc5dd8807e498793a4a2280b6577 /actionpack
parent3c282f3a0a7c1d5ab91241674251794ead5fa41d (diff)
downloadrails-24a8ae4e08fcd15a8c3792990d1d0981d004d339.tar.gz
rails-24a8ae4e08fcd15a8c3792990d1d0981d004d339.tar.bz2
rails-24a8ae4e08fcd15a8c3792990d1d0981d004d339.zip
Try to get more useful errors out of the test_line_offset failures
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/controller/render_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index a857810b78..9a94db4b00 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -101,12 +101,7 @@ class TestController < ActionController::Base
end
def render_line_offset
- begin
- render :inline => '<% raise %>', :locals => {:foo => 'bar'}
- rescue RuntimeError => exc
- end
- line = exc.backtrace.first
- render :text => line
+ render :inline => '<% raise %>', :locals => {:foo => 'bar'}
end
def heading
@@ -238,10 +233,15 @@ class RenderTest < Test::Unit::TestCase
end
def test_line_offset
- get :render_line_offset
- line = @response.body
- assert(line =~ %r{:(\d+):})
- assert_equal "1", $1
+ begin
+ get :render_line_offset
+ flunk "the action should have raised an exception"
+ rescue RuntimeError => exc
+ line = exc.backtrace.first
+ assert(line =~ %r{:(\d+):})
+ assert_equal "1", $1,
+ "The line offset is wrong, perhaps the wrong exception has been raised, exception was: #{exc.inspect}"
+ end
end
def test_render_with_forward_slash