From 0f3960f8f56c2330c07bc6f22d826279a8cd84e5 Mon Sep 17 00:00:00 2001 From: Radhika Chippada Date: Wed, 11 Mar 2015 16:36:51 -0400 Subject: [PATCH] 5145: include manifest text in assert error message to identify the cause of test failure in jenkins. --- .../controllers/actions_controller_test.rb | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/workbench/test/controllers/actions_controller_test.rb b/apps/workbench/test/controllers/actions_controller_test.rb index d8c17c9d82..8745d96792 100644 --- a/apps/workbench/test/controllers/actions_controller_test.rb +++ b/apps/workbench/test/controllers/actions_controller_test.rb @@ -97,19 +97,19 @@ class ActionsControllerTest < ActionController::TestCase streams.each do |stream| if stream.start_with? './dir1' # dir1 stream - assert stream.include?(':alice(1)'), 'Not found: alice(1) in dir1' - assert stream.include?(':alice.txt'), 'Not found: alice.txt in dir1' - assert stream.include?(':alice(1).txt'), 'Not found: alice(1).txt in dir1' - assert stream.include?(':bob.txt'), 'Not found: bob.txt in dir1' - assert stream.include?(':carol.txt'), 'Not found: carol.txt in dir1' + assert stream.include?(':alice(1)'), "Not found: alice(1) in dir1 in manifest text #{manifest_text}" + assert stream.include?(':alice.txt'), "Not found: alice.txt in dir1 in manifest text #{manifest_text}" + assert stream.include?(':alice(1).txt'), "Not found: alice(1).txt in dir1 in manifest text #{manifest_text}" + assert stream.include?(':bob.txt'), "Not found: bob.txt in dir1 in manifest text #{manifest_text}" + assert stream.include?(':carol.txt'), "Not found: carol.txt in dir1 in manifest text #{manifest_text}" elsif stream.start_with? './dir2' # dir2 stream - assert stream.include?(':alice.txt'), 'Not found: alice.txt in dir2' - assert stream.include?(':alice(1).txt'), 'Not found: alice(1).txt in dir2' + assert stream.include?(':alice.txt'), "Not found: alice.txt in dir2 in manifest text #{manifest_text}" + assert stream.include?(':alice(1).txt'), "Not found: alice(1).txt in dir2 in manifest text #{manifest_text}" elsif stream.start_with? '. ' # . stream - assert stream.include?(':foo'), 'Not found: foo in .' - assert stream.include?(':foo(1)'), 'Not found: foo(1) in .' + assert stream.include?(':foo'), "Not found: foo in . in manifest text #{manifest_text}" + assert stream.include?(':foo(1)'), "Not found: foo(1) in . in manifest text #{manifest_text}" end end end @@ -159,8 +159,8 @@ class ActionsControllerTest < ActionController::TestCase manifest_text = collection['manifest_text'] streams = manifest_text.split "\n" - assert_equal 1, streams.length - assert manifest_text.include?('foo'), 'Found foo in new collection manifest text' - assert manifest_text.include?('foo(1)'), 'Found foo(1) in new collection manifest text' + assert_equal 1, streams.length, "Incorrect number of streams in #{manifest_text}" + assert manifest_text.include?('foo'), "Not found foo in new collection manifest text #{manifest_text}" + assert manifest_text.include?('foo(1)'), "Not found foo(1) in new collection manifest text #{manifest_text}" end end -- 2.30.2