Skip to content

Commit 832812a

Browse files
committed
✅ Copy assert_pattern from minitest
1 parent 8655aeb commit 832812a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/lib/helper.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,16 @@ def wait_for_response_count(imap, type:, count:,
4242
sleep interval
4343
end
4444
end
45+
46+
# Copied from minitest
47+
def assert_pattern
48+
flunk "assert_pattern requires a block to capture errors." unless block_given?
49+
assert_block do
50+
yield
51+
true
52+
rescue NoMatchingPatternError => e
53+
flunk e.message
54+
end
55+
end
56+
4557
end

0 commit comments

Comments
 (0)