Sha256: 45d94c61254703f9e64e8e5a421e9dfb68db64630285b90f9ae4420da4f946c2
Contents?: true
Size: 953 Bytes
Versions: 12
Compression:
Stored size: 953 Bytes
Contents
# typed: strict # frozen_string_literal: true module Minitest module Distributed module Filters class IncludeFilter extend T::Sig include FilterInterface sig { returns(T.any(String, Regexp)) } attr_reader :filter sig { params(filter: T.any(String, Regexp)).void } def initialize(filter) @filter = filter if filter.is_a?(String) && (match_info = filter.match(%r%/(.*)/%)) @filter = Regexp.new(T.must(match_info[1])) end end sig { override.params(runnable: Minitest::Runnable).returns(T::Array[Minitest::Runnable]) } def call(runnable) # rubocop:disable Style/CaseEquality if filter === runnable.name || filter === DefinedRunnable.identifier(runnable) [runnable] else [] end # rubocop:enable Style/CaseEquality end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems