Class: Minitest::Distributed::Filters::IncludeFilter
- Inherits:
-
Object
- Object
- Minitest::Distributed::Filters::IncludeFilter
- Extended by:
- T::Sig
- Includes:
- FilterInterface
- Defined in:
- lib/minitest/distributed/filters/include_filter.rb
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
Instance Method Summary collapse
- #call(runnable) ⇒ Object
-
#initialize(filter) ⇒ IncludeFilter
constructor
A new instance of IncludeFilter.
Constructor Details
#initialize(filter) ⇒ IncludeFilter
Returns a new instance of IncludeFilter.
15 16 17 18 19 20 |
# File 'lib/minitest/distributed/filters/include_filter.rb', line 15 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 |
Instance Attribute Details
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
12 13 14 |
# File 'lib/minitest/distributed/filters/include_filter.rb', line 12 def filter @filter end |
Instance Method Details
#call(runnable) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/minitest/distributed/filters/include_filter.rb', line 23 def call(runnable) # rubocop:disable Style/CaseEquality if filter === runnable.name || filter === DefinedRunnable.identifier(runnable) [runnable] else [] end # rubocop:enable Style/CaseEquality end |