Class: WhatToRun::Runner

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

Overview

Abstract base spec runner

Direct Known Subclasses

Minitest::Runner, WhatToRun::RSpec::Runner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Runner

Returns a new instance of Runner.



9
10
11
# File 'lib/what_to_run/runner.rb', line 9

def initialize(opts = {})
  @executable = opts.fetch(:exec)
end

Instance Attribute Details

#collectObject (readonly)

Returns the value of attribute collect.



7
8
9
# File 'lib/what_to_run/runner.rb', line 7

def collect
  @collect
end

#executableObject (readonly)

Returns the value of attribute executable.



7
8
9
# File 'lib/what_to_run/runner.rb', line 7

def executable
  @executable
end

Instance Method Details

#runObject



13
14
15
16
17
18
19
# File 'lib/what_to_run/runner.rb', line 13

def run
  if predicted_examples.empty?
    exit 0
  else
    Kernel.exec command
  end
end