Class: TestDiff::BuildCoverageDiff

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

Overview

class used to build the coverage file

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec_folder, pre_load, continue) ⇒ BuildCoverageDiff

Returns a new instance of BuildCoverageDiff.



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

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

Instance Attribute Details

#pre_loadObject (readonly)

Returns the value of attribute pre_load.



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

def pre_load
  @pre_load
end

#sha1Object (readonly)

Returns the value of attribute sha1.



5
6
7
# File 'lib/test_diff/build_coverage_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/build_coverage_diff.rb', line 5

def spec_folder
  @spec_folder
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
# File 'lib/test_diff/build_coverage_diff.rb', line 16

def run
  add_changed_files
  remove_tests_that_do_not_exist
  remove_tests_in_wrong_folder
  require 'coverage.so'
  Coverage.start
  require_pre_load
  run_batch
end