Class: TestDiff::RunDiff

Inherits:
Object
  • Object
show all
Defined in:
lib/test_diff/run_diff.rb

Overview

Class used to calculate the tests than need to be run

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec_folder, sha1, groups_of, group) ⇒ RunDiff



7
8
9
10
11
12
13
14
# File 'lib/test_diff/run_diff.rb', line 7

def initialize(spec_folder, sha1, groups_of, group)
  @spec_folder = spec_folder
  @sha1 = sha1 ||  File.read('test_diff_coverage/sha')
  @specs_to_run = []
  @storage = Storage.new
  @groups_of = groups_of
  @group = group
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



5
6
7
# File 'lib/test_diff/run_diff.rb', line 5

def group
  @group
end

#groups_ofObject (readonly)

Returns the value of attribute groups_of.



5
6
7
# File 'lib/test_diff/run_diff.rb', line 5

def groups_of
  @groups_of
end

#sha1Object (readonly)

Returns the value of attribute sha1.



5
6
7
# File 'lib/test_diff/run_diff.rb', line 5

def sha1
  @sha1
end

#spec_folderObject (readonly)

Returns the value of attribute spec_folder.



5
6
7
# File 'lib/test_diff/run_diff.rb', line 5

def spec_folder
  @spec_folder
end

Instance Method Details

#runObject



16
17
18
19
20
21
# File 'lib/test_diff/run_diff.rb', line 16

def run
  add_changed_files
  remove_tests_in_wrong_folder
  select_test_group
  run_test_group
end