Class: Retest::Runners::Runner

Inherits:
Object
  • Object
show all
Includes:
Observable
Defined in:
lib/retest/runners/runner.rb

Direct Known Subclasses

ChangeRunner, TestRunner, VariableRunner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, stdout: $stdout) ⇒ Runner

Returns a new instance of Runner.



7
8
9
10
# File 'lib/retest/runners/runner.rb', line 7

def initialize(command, stdout: $stdout)
  @stdout  = stdout
  @command = command
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



6
7
8
# File 'lib/retest/runners/runner.rb', line 6

def command
  @command
end

#stdoutObject

Returns the value of attribute stdout.



6
7
8
# File 'lib/retest/runners/runner.rb', line 6

def stdout
  @stdout
end

Instance Method Details

#==(obj) ⇒ Object



12
13
14
# File 'lib/retest/runners/runner.rb', line 12

def ==(obj)
  command == obj.command && obj.class == self.class
end

#run(changed_file = nil, repository: nil) ⇒ Object



16
17
18
# File 'lib/retest/runners/runner.rb', line 16

def run(changed_file = nil, repository: nil)
  system_run command
end

#run_all_tests(tests_string) ⇒ Object



20
21
22
23
# File 'lib/retest/runners/runner.rb', line 20

def run_all_tests(tests_string)
  log("Test File Selected: #{tests_string}")
  system_run command.gsub('<test>', tests_string)
end

#sync(added:, removed:) ⇒ Object



25
26
# File 'lib/retest/runners/runner.rb', line 25

def sync(added:, removed:)
end