From 73f0e1a8423d53370f272841ce29747434de4d9a Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Mon, 17 May 2010 14:40:56 -0400 Subject: [PATCH] Use assert_respond_to because it has better error messaging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#4628 state:resolved] Signed-off-by: José Valim --- actionpack/test/abstract/translation_test.rb | 8 ++++---- actionpack/test/controller/integration_test.rb | 4 ++-- actionpack/test/controller/send_file_test.rb | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/actionpack/test/abstract/translation_test.rb b/actionpack/test/abstract/translation_test.rb index 0bf61a6556..09ebfab85e 100644 --- a/actionpack/test/abstract/translation_test.rb +++ b/actionpack/test/abstract/translation_test.rb @@ -9,18 +9,18 @@ class TranslationControllerTest < Test::Unit::TestCase end def test_action_controller_base_responds_to_translate - assert @controller.respond_to?(:translate) + assert_respond_to @controller, :translate end def test_action_controller_base_responds_to_t - assert @controller.respond_to?(:t) + assert_respond_to @controller, :t end def test_action_controller_base_responds_to_localize - assert @controller.respond_to?(:localize) + assert_respond_to @controller, :localize end def test_action_controller_base_responds_to_l - assert @controller.respond_to?(:l) + assert_respond_to @controller, :l end end \ No newline at end of file diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index 20dc96d38d..5ee8e2b6ae 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -176,8 +176,8 @@ class IntegrationTestTest < Test::Unit::TestCase session1 = @test.open_session { |sess| } session2 = @test.open_session # implicit session - assert session1.respond_to?(:assert_template), "open_session makes assert_template available" - assert session2.respond_to?(:assert_template), "open_session makes assert_template available" + assert_respond_to session1, :assert_template, "open_session makes assert_template available" + assert_respond_to session2, :assert_template, "open_session makes assert_template available" assert !session1.equal?(session2) end diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb index 36b8055810..c7c8360ae6 100644 --- a/actionpack/test/controller/send_file_test.rb +++ b/actionpack/test/controller/send_file_test.rb @@ -55,8 +55,8 @@ class SendFileTest < ActionController::TestCase response = nil assert_nothing_raised { response = process('file') } assert_not_nil response - assert response.body_parts.respond_to?(:each) - assert response.body_parts.respond_to?(:to_path) + assert_respond_to response.body_parts, :each + assert_respond_to response.body_parts, :to_path require 'stringio' output = StringIO.new