Skip to content

Commit

Permalink
✅ Copy assert_pattern from minitest
Browse files Browse the repository at this point in the history
  • Loading branch information
nevans committed Nov 25, 2024
1 parent da3b43d commit 5f053cf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/lib/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,16 @@ def wait_for_response_count(imap, type:, count:,
sleep interval
end
end

# Copied from minitest
def assert_pattern
flunk "assert_pattern requires a block to capture errors." unless block_given?
assert_block do
yield
true
rescue NoMatchingPatternError => e
flunk e.message
end
end

end

0 comments on commit 5f053cf

Please sign in to comment.