Class: Rails::CompositeFilter

Inherits:
Object
  • Object
show all
Defined in:
railties/lib/rails/test_unit/line_filtering.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runnable, filter, patterns) ⇒ CompositeFilter

Returns a new instance of CompositeFilter.


18
19
20
21
22
# File 'railties/lib/rails/test_unit/line_filtering.rb', line 18

def initialize(runnable, filter, patterns)
  @runnable = runnable
  @named_filter = derive_named_filter(filter)
  @filters = [ @named_filter, *derive_line_filters(patterns) ].compact
end

Instance Attribute Details

#named_filterObject (readonly)

Returns the value of attribute named_filter


16
17
18
# File 'railties/lib/rails/test_unit/line_filtering.rb', line 16

def named_filter
  @named_filter
end

Instance Method Details

#===(method) ⇒ Object

Minitest uses === to find matching filters.


25
26
27
# File 'railties/lib/rails/test_unit/line_filtering.rb', line 25

def ===(method)
  @filters.any? { |filter| filter === method }
end