Class: Minitest::Distributed::Filters::FileFilterBase

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/minitest/distributed/filters/file_filter_base.rb

Direct Known Subclasses

ExcludeFileFilter, IncludeFileFilter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ FileFilterBase

Returns a new instance of FileFilterBase.



14
15
16
17
# File 'lib/minitest/distributed/filters/file_filter_base.rb', line 14

def initialize(file)
  @file = file
  @tests = T.let(nil, T.nilable(T::Set[String]))
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



11
12
13
# File 'lib/minitest/distributed/filters/file_filter_base.rb', line 11

def file
  @file
end

Instance Method Details

#testsObject



20
21
22
23
24
25
# File 'lib/minitest/distributed/filters/file_filter_base.rb', line 20

def tests
  @tests ||= begin
    tests = File.readlines(@file, chomp: true)
    Set.new(tests)
  end
end