Class: Minitest::Bisect::PathExpander

Inherits:
PathExpander
  • Object
show all
Defined in:
lib/minitest/bisect.rb

Constant Summary collapse

TEST_GLOB =

:nodoc:

"**/{test_*,*_test,spec_*,*_spec}.rb"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = ARGV) ⇒ PathExpander

:nodoc:



15
16
17
18
# File 'lib/minitest/bisect.rb', line 15

def initialize args = ARGV # :nodoc:
  super args, TEST_GLOB
  self.rb_flags = %w[-Itest:lib]
end

Instance Attribute Details

#rb_flagsObject

Returns the value of attribute rb_flags.



13
14
15
# File 'lib/minitest/bisect.rb', line 13

def rb_flags
  @rb_flags
end

Instance Method Details

#process_flags(flags) ⇒ Object

Overrides PathExpander#process_flags to filter out ruby flags from minitest flags. Only supports -I<paths>, -d, and -w for ruby.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/minitest/bisect.rb', line 25

def process_flags flags
  flags.reject { |flag| # all hits are truthy, so this works out well
    case flag
    when /^-I(.*)/ then
      rb_flags << flag
    when /^-d/ then
      rb_flags << flag
    when /^-w/ then
      rb_flags << flag
    else
      false
    end
  }
end