diff options
author | Federico Ravasio <ravasio.federico@gmail.com> | 2013-11-24 14:18:00 +0100 |
---|---|---|
committer | Federico Ravasio <ravasio.federico@gmail.com> | 2013-11-24 14:18:00 +0100 |
commit | 0bc95ed95adb52e6ad29644da1c1542ce566ce61 (patch) | |
tree | 0234f94e34a4fd7fde5bbf07bf9d1cae3435d001 /actionpack/test/controller | |
parent | a0f1e6a27ae1a9593c107296d132b4c5605a7175 (diff) | |
download | rails-0bc95ed95adb52e6ad29644da1c1542ce566ce61.tar.gz rails-0bc95ed95adb52e6ad29644da1c1542ce566ce61.tar.bz2 rails-0bc95ed95adb52e6ad29644da1c1542ce566ce61.zip |
Raise RuntimeErrors with inspectable and MRI-independent messages.
Previous behaviour was MRI-dependent, now we're making sure the message
is correctly shown: something that can be relyied upon across every
Ruby implementation.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/new_base/render_streaming_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/new_base/render_template_test.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/test/controller/new_base/render_streaming_test.rb b/actionpack/test/controller/new_base/render_streaming_test.rb index 2b36a399bb..4c9126ca8c 100644 --- a/actionpack/test/controller/new_base/render_streaming_test.rb +++ b/actionpack/test/controller/new_base/render_streaming_test.rb @@ -4,7 +4,7 @@ module RenderStreaming class BasicController < ActionController::Base self.view_paths = [ActionView::FixtureResolver.new( "render_streaming/basic/hello_world.html.erb" => "Hello world", - "render_streaming/basic/boom.html.erb" => "<%= nil.invalid! %>", + "render_streaming/basic/boom.html.erb" => "<%= raise 'Ruby was here!' %>", "layouts/application.html.erb" => "<%= yield %>, I'm here!", "layouts/boom.html.erb" => "<body class=\"<%= nil.invalid! %>\"<%= yield %></body>" )] @@ -90,7 +90,7 @@ module RenderStreaming begin get "/render_streaming/basic/template_exception" io.rewind - assert_match "(undefined method `invalid!' for nil:NilClass)", io.read + assert_match "Ruby was here!", io.read ensure ActionView::Base.logger = _old end diff --git a/actionpack/test/controller/new_base/render_template_test.rb b/actionpack/test/controller/new_base/render_template_test.rb index 6b2ae2b2a9..b7a9cf92f2 100644 --- a/actionpack/test/controller/new_base/render_template_test.rb +++ b/actionpack/test/controller/new_base/render_template_test.rb @@ -14,7 +14,7 @@ module RenderTemplate "test/with_json.html.erb" => "<%= render :template => 'test/with_json', :formats => [:json] %>", "test/with_json.json.erb" => "<%= render :template => 'test/final', :formats => [:json] %>", "test/final.json.erb" => "{ final: json }", - "test/with_error.html.erb" => "<%= idontexist %>" + "test/with_error.html.erb" => "<%= raise 'i do not exist' %>" )] def index @@ -132,7 +132,7 @@ module RenderTemplate test "rendering a template with error properly excerts the code" do get :with_error assert_status 500 - assert_match "undefined local variable or method `idontexist", response.body + assert_match "i do not exist", response.body end end |