From c1d700c82e65c22f9401cef470dbeb1b8da4cc2a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 14 Apr 2015 23:49:46 +0200 Subject: [PATCH] Only do cleanup on match() in certain cases. --- test/browser/aac_basic_richtext_test.rb | 10 ++++++---- test/browser_test_helper.rb | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/browser/aac_basic_richtext_test.rb b/test/browser/aac_basic_richtext_test.rb index 88cc11a87..506832b02 100644 --- a/test/browser/aac_basic_richtext_test.rb +++ b/test/browser/aac_basic_richtext_test.rb @@ -43,8 +43,9 @@ class AACBasicRichtextTest < TestCase sleep 1 match( - :css => '#content .text-3', - :value => "some test for browser\nand some other for browser", + :css => '#content .text-3', + :value => "some test for browser\nand some other for browser", + :cleanup => true, ) # richtext multi line @@ -59,8 +60,9 @@ class AACBasicRichtextTest < TestCase sleep 1 match( - :css => '#content .text-5', - :value => "some test for browser\nand some other for browser2", + :css => '#content .text-5', + :value => "some test for browser\nand some other for browser2", + :cleanup => true, ) end end \ No newline at end of file diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index d0dce12ce..276f7e15c 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -467,8 +467,10 @@ class TestCase < Test::Unit::TestCase end # do cleanups (needed for richtext tests) - text.gsub!(/\s+$/m, '') - params[:value].gsub!(/\s+$/m, '') + if params[:cleanup] + text.gsub!(/\s+$/m, '') + params[:value].gsub!(/\s+$/m, '') + end match = false if params[:no_quote]