module Minitest::Assertions

def assert_pattern

def assert_pattern
  raise NotImplementedError, "only available in Ruby 3.0+" unless RUBY_VERSION >= "3.0"
  flunk "assert_pattern requires a block to capture errors." unless block_given?
  begin # TODO: remove after ruby 2.6 dropped
    yield
    pass
  rescue NoMatchingPatternError => e
    flunk e.message
  end
end