From b4629528866446aa59f663a1162edbdacee85600 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Tue, 18 May 2010 21:47:24 -0400 Subject: Use better assertion methods for testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#4645 state:resolved] Signed-off-by: José Valim --- actionpack/test/controller/filters_test.rb | 14 +++++++------- actionpack/test/controller/new_base/bare_metal_test.rb | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'actionpack') diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index ea740f7233..d5704eba78 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -515,7 +515,7 @@ class FilterTest < ActionController::TestCase assert assigns["ran_proc_filter2"] test_process(AnomolousYetValidConditionController, "show_without_filter") - assert_equal nil, assigns["ran_filter"] + assert_nil assigns["ran_filter"] assert !assigns["ran_class_filter"] assert !assigns["ran_proc_filter1"] assert !assigns["ran_proc_filter2"] @@ -530,16 +530,16 @@ class FilterTest < ActionController::TestCase test_process(ConditionalCollectionFilterController) assert_equal %w( ensure_login ), assigns["ran_filter"] test_process(ConditionalCollectionFilterController, "show_without_filter") - assert_equal nil, assigns["ran_filter"] + assert_nil assigns["ran_filter"] test_process(ConditionalCollectionFilterController, "another_action") - assert_equal nil, assigns["ran_filter"] + assert_nil assigns["ran_filter"] end def test_running_only_condition_filters test_process(OnlyConditionSymController) assert_equal %w( ensure_login ), assigns["ran_filter"] test_process(OnlyConditionSymController, "show_without_filter") - assert_equal nil, assigns["ran_filter"] + assert_nil assigns["ran_filter"] test_process(OnlyConditionProcController) assert assigns["ran_proc_filter"] @@ -556,7 +556,7 @@ class FilterTest < ActionController::TestCase test_process(ExceptConditionSymController) assert_equal %w( ensure_login ), assigns["ran_filter"] test_process(ExceptConditionSymController, "show_without_filter") - assert_equal nil, assigns["ran_filter"] + assert_nil assigns["ran_filter"] test_process(ExceptConditionProcController) assert assigns["ran_proc_filter"] @@ -573,7 +573,7 @@ class FilterTest < ActionController::TestCase test_process(BeforeAndAfterConditionController) assert_equal %w( ensure_login clean_up_tmp), assigns["ran_filter"] test_process(BeforeAndAfterConditionController, "show_without_filter") - assert_equal nil, assigns["ran_filter"] + assert_nil assigns["ran_filter"] end def test_around_filter @@ -674,7 +674,7 @@ class FilterTest < ActionController::TestCase def test_changing_the_requirements test_process(ChangingTheRequirementsController, "go_wild") - assert_equal nil, assigns['ran_filter'] + assert_nil assigns['ran_filter'] end def test_a_rescuing_around_filter diff --git a/actionpack/test/controller/new_base/bare_metal_test.rb b/actionpack/test/controller/new_base/bare_metal_test.rb index df4b39a103..8a06e8d2a0 100644 --- a/actionpack/test/controller/new_base/bare_metal_test.rb +++ b/actionpack/test/controller/new_base/bare_metal_test.rb @@ -18,10 +18,10 @@ module BareMetalTest string << part end - assert headers.is_a?(Hash), "Headers must be a Hash" + assert_kind_of Hash, headers, "Headers must be a Hash" assert headers["Content-Type"], "Content-Type must exist" assert_equal "Hello world", string end end -end \ No newline at end of file +end -- cgit v1.2.3