rspec_parallel 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/rspec_parallel.rb +4 -6
  2. metadata +2 -2
@@ -14,6 +14,7 @@ class Rspec_parallel
14
14
  attr_reader :failure_number
15
15
  attr_reader :pending_number
16
16
  attr_reader :case_info_list
17
+ attr_reader :interrupted
17
18
 
18
19
  attr_accessor :thread_number
19
20
  attr_accessor :max_rerun_times
@@ -30,11 +31,11 @@ class Rspec_parallel
30
31
  @case_number = 0
31
32
  @failure_number = 0
32
33
  @pending_number = 0
34
+ @interrupted = false
33
35
  end
34
36
 
35
37
  def run_tests()
36
38
  start_time = Time.now # timer of rspec task
37
- interrupted = false # whether there is a interrupt
38
39
  @queue = Queue.new # store all tests to run
39
40
  @case_info_list = [] # store results of all tests
40
41
  @lock = Mutex.new # use lock to avoid output mess up
@@ -134,7 +135,8 @@ class Rspec_parallel
134
135
  begin
135
136
  threads.each { |t| t.join }
136
137
  rescue Interrupt
137
- interrupted = true
138
+ puts yellow("catch Ctrl+C, will exit gracefully")
139
+ @interrupted = true
138
140
  end
139
141
  pbar.finish
140
142
 
@@ -172,10 +174,6 @@ class Rspec_parallel
172
174
  end
173
175
 
174
176
  generate_reports(end_time - start_time, rerun && !separate_rerun_report)
175
-
176
- if interrupted
177
- raise Interrupt
178
- end
179
177
  end
180
178
 
181
179
  def get_case_list
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-05 00:00:00.000000000 Z
12
+ date: 2012-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: progressbar