From d747c127173e307a7447fca29cd8744dbd83a837 Mon Sep 17 00:00:00 2001 From: ono-max Date: Tue, 8 Jun 2021 10:29:31 +0900 Subject: [PATCH] modify assert_line_text method to be able to make correct assertions --- test/support/utils.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/support/utils.rb b/test/support/utils.rb index 20bc51286..b35509a7c 100644 --- a/test/support/utils.rb +++ b/test/support/utils.rb @@ -18,11 +18,15 @@ def assert_line_num(expected) def assert_line_text(expected) @queue.push(Proc.new { - assert_block do - @internal_info['backlog'].each do |line| - line.include? expected + msg = "Expected to include #{expected} in #{@internal_info['location']}" + result = false + @internal_info['backlog'].each do |line| + if line.match? expected + result = true + break end end + assert_true(result, msg) }) end