Class: TestChanges::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/test_changes/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.



3
4
5
6
# File 'lib/test_changes/client.rb', line 3

def initialize(options)
  @argv_wrapper = options[:argv_wrapper]
  @runner = options[:runner]
end

Instance Method Details

#callObject

rubocop:disable Metrics/AbcSize



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/test_changes/client.rb', line 9

def call
  log "Paths changed since commit #{argv_wrapper.commit}:",
    paths_changed_since_commit.inspect

  log "Matches:", matches.inspect

  log "Existing matches:", existing_matches.inspect

  return if existing_matches.empty?

  log "Non-excluded matches:", included_matches.inspect

  return if included_matches.empty?

  log "Test tool call:", test_tool_call
  system(test_tool_call)
end