Class: TestBoosters::Boosters::Base
- Inherits:
-
Object
- Object
- TestBoosters::Boosters::Base
show all
- Defined in:
- lib/test_boosters/boosters/base.rb
Instance Method Summary
collapse
Constructor Details
#initialize(file_pattern, split_configuration_path, command) ⇒ Base
Returns a new instance of Base.
5
6
7
8
9
|
# File 'lib/test_boosters/boosters/base.rb', line 5
def initialize(file_pattern, split_configuration_path, command)
@command = command
@file_pattern = file_pattern
@split_configuration_path = split_configuration_path
end
|
Instance Method Details
#after_job ⇒ Object
32
33
34
|
# File 'lib/test_boosters/boosters/base.rb', line 32
def after_job
end
|
#before_job ⇒ Object
28
29
30
|
# File 'lib/test_boosters/boosters/base.rb', line 28
def before_job
end
|
36
37
38
39
40
41
|
# File 'lib/test_boosters/boosters/base.rb', line 36
def
version = "Test Booster v#{TestBoosters::VERSION}"
job_info = "Job #{job_index + 1} out of #{job_count}"
TestBoosters::Shell.display_title("#{version} - #{job_info}")
end
|
#distribution ⇒ Object
43
44
45
46
47
|
# File 'lib/test_boosters/boosters/base.rb', line 43
def distribution
@distribution ||= TestBoosters::Files::Distributor.new(@split_configuration_path,
@file_pattern,
job_count)
end
|
#job_count ⇒ Object
53
54
55
|
# File 'lib/test_boosters/boosters/base.rb', line 53
def job_count
@job_count ||= cli_options[:job_count]
end
|
#job_index ⇒ Object
49
50
51
|
# File 'lib/test_boosters/boosters/base.rb', line 49
def job_index
@job_index ||= cli_options[:job_index] - 1
end
|
#run ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/test_boosters/boosters/base.rb', line 12
def run
before_job
distribution.display_info
known, leftover = distribution.files_for(job_index)
exit_status = TestBoosters::Job.run(@command, known, leftover)
after_job
exit_status
end
|