Class: TestDiff::TrackBuild

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

Overview

Class used to calculate the tests than need to be run

Instance Method Summary collapse

Constructor Details

#initialize(sha, git_dir) ⇒ TrackBuild

Returns a new instance of TrackBuild.



7
8
9
10
# File 'lib/test_diff/track_build.rb', line 7

def initialize(sha, git_dir)
  @git_dir = git_dir
  @sha = sha
end

Instance Method Details

#runObject



12
13
14
15
16
17
# File 'lib/test_diff/track_build.rb', line 12

def run
  git = Git.open(@git_dir || '.')
  sha = git.object(@sha || 'HEAD').sha
  File.open('test_diff_coverage/sha', 'w+') { |f| f << sha }
  puts 'updated test_diff_coverage/sha'
end