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(tests_folder, groups_of, group) ⇒ RunDiff

Returns a new instance of RunDiff.



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

def initialize(tests_folder, groups_of, group)
  @tests_folder = tests_folder
  @tests_to_run = []
  @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

#tests_folderObject (readonly)

Returns the value of attribute tests_folder.



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

def tests_folder
  @tests_folder
end

Instance Method Details

#runObject



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

def run
  add_changed_files
  remove_tests_that_do_not_exist
  remove_tests_in_wrong_folder
  select_test_group
  run_test_group
end