Class: Mutante::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/mutante/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration: Mutante.configuration, reporter: nil, verbose: false, test_runner: nil, file_finder: nil, spec_finder: nil) ⇒ Runner

Returns a new instance of Runner.



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/mutante/runner.rb', line 3

def initialize(configuration: Mutante.configuration,
               reporter: nil,
               verbose: false,
               test_runner: nil,
               file_finder: nil,
               spec_finder: nil)
  @configuration = configuration
  @reporter      = reporter || Reporter.new(force_plain: verbose)
  @verbose       = verbose
  @finder        = file_finder || FileFinder.new(configuration)
  @spec_finder   = spec_finder || SpecFinder.new(configuration)
  @test_runner   = test_runner || TestRunner.new(configuration, verbose: verbose)
end

Instance Method Details

#call(target = nil) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/mutante/runner.rb', line 17

def call(target = nil)
  files = @finder.call(target)
  @reporter.starting(files)

  return false unless baseline_passes?

  files.each { |f| analyze_file(f) }
  @reporter.finished
  true
end