From 584c4b39ef1e5be998c94faa2049e54993b6f0d0 Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Sun, 23 Jan 2005 19:12:57 +0000 Subject: [PATCH] Preventing an endless loop in case test_helper is loaded twice (note to self: _always_ enclose alias within unless method_defined?) --- test/test_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 729aa96f..5b3e3e13 100755 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -5,7 +5,7 @@ require 'test/unit' require 'action_controller/test_process' # Uncomment this variable to have assert_success check that response bodies are valid XML -# $validate_xml_in_assert_success = true +$validate_xml_in_assert_success = true # Convenient setup method for Test::Unit::TestCase class Test::Unit::TestCase @@ -99,7 +99,9 @@ if defined? $validate_xml_in_assert_success and $validate_xml_in_assert_success module Test module Unit module Assertions - alias :__assert_success_before_ovverride_by_instiki :assert_success + unless method_defined? :__assert_success_before_ovverride_by_instiki + alias :__assert_success_before_ovverride_by_instiki :assert_success + end def assert_success __assert_success_before_ovverride_by_instiki if @response.body.kind_of?(Proc) then # it's a file download, not an HTML content