Class: Rails::TestUnit::CompositeFilter
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | railties/lib/rails/test_unit/runner.rb |
Class Method Summary
Instance Attribute Summary
- #named_filter readonly
Instance Method Summary
-
#===(method)
minitest uses === to find matching filters.
- #derive_line_filters(patterns) private
- #derive_named_filter(filter) private
Constructor Details
.new(runnable, filter, patterns) ⇒ CompositeFilter
# File 'railties/lib/rails/test_unit/runner.rb', line 150
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_filter (readonly)
[ GitHub ]# File 'railties/lib/rails/test_unit/runner.rb', line 148
attr_reader :named_filter
Instance Method Details
#===(method)
minitest uses === to find matching filters.
# File 'railties/lib/rails/test_unit/runner.rb', line 157
def ===(method) @filters.any? { |filter| filter === method } end
#derive_line_filters(patterns) (private)
[ GitHub ]#derive_named_filter(filter) (private)
[ GitHub ]# File 'railties/lib/rails/test_unit/runner.rb', line 162
def derive_named_filter(filter) if filter.respond_to?(:named_filter) filter.named_filter elsif filter =~ %r%/(.*)/% # Regexp filtering copied from minitest. Regexp.new $1 elsif filter.is_a?(String) filter end end