fuubar 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 61d657955ac1c05578bc1f353206071a49bf1afc
4
- data.tar.gz: 1ce6a4b5e6442ff0430ad5d4405c29a706ca9335
2
+ SHA256:
3
+ metadata.gz: bc131d5dbd7aa378742d9358d78351fa7ed928083faac077f2b0a553cd2e4018
4
+ data.tar.gz: 771c6d140e875296f0bcdefdfb7904b42723f6f66bdc92511311a08d49fb783c
5
5
  SHA512:
6
- metadata.gz: 97c88ec3b21330433ee8f8e40286636d684c3fef21c843e7d825e824af55881666827ffbbc9cb2118e68f5ea6dd3f673e87f897316122b18e9885f9c64f3c32b
7
- data.tar.gz: c9be4d487d51d8aee94b8d8387781f9cf6d6069ec89a44fa3a1d4ab884ffb7ceabb62a2e3d2e5e6abb51ae3c6a08920a5f42585799aaf7a6c5478c95a836b156
6
+ metadata.gz: b05503c671beaf5a2d9a4184f9d3c0e216c4f1cdf31732db26de0a9f323b57325bc4fe5959d3c324e124cfb7374bc7b2d93b1d5acace372d58bf7ec7bd2907a6
7
+ data.tar.gz: d537243787d29fc734dc9180b570c659785f6103be90169d61c2ebabcbd835fbe990445cedc7daebc0e0ddc3630be0d11a44d18067ffa8d64eff19ce41bc50bf
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -31,21 +31,21 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
31
31
 
32
32
  self.example_tick_lock = Mutex.new
33
33
  self.progress = ProgressBar.create(
34
- DEFAULT_PROGRESS_BAR_OPTIONS
35
- .merge(:throttle_rate => continuous_integration? ? 1.0 : nil)
36
- .merge(:total => 0,
37
- :output => output,
38
- :autostart => false)
34
+ DEFAULT_PROGRESS_BAR_OPTIONS.
35
+ merge(:throttle_rate => continuous_integration? ? 1.0 : nil).
36
+ merge(:total => 0,
37
+ :output => output,
38
+ :autostart => false)
39
39
  )
40
40
  end
41
41
 
42
42
  def start(notification)
43
- progress_bar_options = DEFAULT_PROGRESS_BAR_OPTIONS
44
- .merge(:throttle_rate => continuous_integration? ? 1.0 : nil)
45
- .merge(configuration.fuubar_progress_bar_options)
46
- .merge(:total => notification.count,
47
- :output => output,
48
- :autostart => false)
43
+ progress_bar_options = DEFAULT_PROGRESS_BAR_OPTIONS.
44
+ merge(:throttle_rate => continuous_integration? ? 1.0 : nil).
45
+ merge(configuration.fuubar_progress_bar_options).
46
+ merge(:total => notification.count,
47
+ :output => output,
48
+ :autostart => false)
49
49
 
50
50
  self.progress = ProgressBar.create(progress_bar_options)
51
51
  self.passed_count = 0
@@ -54,10 +54,10 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
54
54
  self.example_tick_thread = start_tick_thread(notification)
55
55
 
56
56
  if Object.const_defined?('Pry')
57
- Pry
58
- .config
59
- .hooks
60
- .add_hook(:when_started, :fuubar_kill_refresh) do |_target, _opt, _|
57
+ Pry.
58
+ config.
59
+ hooks.
60
+ add_hook(:when_started, :fuubar_kill_refresh) do |_target, _opt, _|
61
61
  example_tick_thread.kill
62
62
  end
63
63
  end
@@ -115,9 +115,11 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
115
115
  #
116
116
  end
117
117
 
118
+ # rubocop:disable Naming/MemoizedInstanceVariableName
118
119
  def output
119
120
  @fuubar_output ||= Fuubar::Output.new(super, configuration.tty?)
120
121
  end
122
+ # rubocop:enable Naming/MemoizedInstanceVariableName
121
123
 
122
124
  private
123
125
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuubar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Evans
@@ -12,28 +12,32 @@ bindir: bin
12
12
  cert_chain:
13
13
  - |
14
14
  -----BEGIN CERTIFICATE-----
15
- MIIDrjCCApagAwIBAgIBATANBgkqhkiG9w0BAQUFAD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LFPBPkzcCAwEAAaOBljCBkzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNV
28
+ HQ4EFgQUUTthhLkcr6+8JU1/B/dxKYaYnKUwLAYDVR0RBCUwI4EhYWNjb3VudHMr
29
+ cnVieWdlbXNAdGhla29tcGFuZWUuY29tMCwGA1UdEgQlMCOBIWFjY291bnRzK3J1
30
+ YnlnZW1zQHRoZWtvbXBhbmVlLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAED2U/MD3
31
+ PHRHyeh9Ge3JTKJ/bjZLYquJWQr+ei4rsNk8oO2O6CcoiC84oNEnpnENHX9KiZu8
32
+ h7ylKO7u6vKJl9p9IV2YR0uOnXbSApYr5olDDlEz7HNGL3xUCJJhJBf09C4AkaAn
33
+ kfaOv9Nkko0izYPpKsGlyKvbWBIzT3urBMRNbv95DzhBdNI6RF0q13eCePPqXPGe
34
+ RaikE1dUWcVsW29XzO/RINmuMcKU6k0caC7X4kTD657Nf74oGUXHxYPmfUmYmppg
35
+ uAF3jK5824uMvxofLysxqXhrUlTuCVndaexDm3bYK+YrTnZJEu6CimpMYa2u6JEE
36
+ sWLZKmDLUxEUs/5jVGuypZbSBJBDb6VnmCkoEr3Fmh4O/FH4IZ+Gd3QdYCohLoKd
37
+ 09JNgxpgZHCDuKwoycU+wXdWVSzMtchMQygnEu6th1SY5qHj4ISipBEBtKG0MdgB
38
+ L3AbMAHTztj5YI+gvmpuV1B4Zv1QZjZWOeNSnLZdrnOQbyyDBzJyXmNV
35
39
  -----END CERTIFICATE-----
36
- date: 2018-01-02 00:00:00.000000000 Z
40
+ date: 2018-08-03 00:00:00.000000000 Z
37
41
  dependencies:
38
42
  - !ruby/object:Gem::Dependency
39
43
  name: rspec-core
@@ -106,7 +110,9 @@ dependencies:
106
110
  - !ruby/object:Gem::Version
107
111
  version: '1.7'
108
112
  description: the instafailing RSpec progress bar formatter
109
- email: '["jeff@kreeftmeijer.nl", "accounts+git@thekompanee.com"]'
113
+ email:
114
+ - jeff@kreeftmeijer.nl
115
+ - accounts+git@thekompanee.com
110
116
  executables: []
111
117
  extensions: []
112
118
  extra_rdoc_files: []
@@ -115,8 +121,6 @@ files:
115
121
  - README.md
116
122
  - lib/fuubar.rb
117
123
  - lib/fuubar/output.rb
118
- - spec/fuubar/output_spec.rb
119
- - spec/fuubar_spec.rb
120
124
  homepage: https://github.com/thekompanee/fuubar
121
125
  licenses:
122
126
  - MIT
@@ -138,10 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
142
  version: '0'
139
143
  requirements: []
140
144
  rubyforge_project:
141
- rubygems_version: 2.6.14
145
+ rubygems_version: 2.7.7
142
146
  signing_key:
143
147
  specification_version: 4
144
148
  summary: the instafailing RSpec progress bar formatter
145
- test_files:
146
- - spec/fuubar/output_spec.rb
147
- - spec/fuubar_spec.rb
149
+ test_files: []
metadata.gz.sig CHANGED
Binary file
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'fuubar'
4
-
5
- class TestNonTtyOutputClass
6
- def tty?
7
- false
8
- end
9
- end
10
-
11
- class TestTtyOutputClass
12
- def hello
13
- 'hello'
14
- end
15
-
16
- def tty?
17
- true
18
- end
19
- end
20
-
21
- class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
22
- describe Output do
23
- it 'delegates anything to the passed in object' do
24
- output = Output.new(TestTtyOutputClass.new)
25
-
26
- expect(output.hello).to eql 'hello'
27
- expect(output).to be_tty
28
- end
29
-
30
- it 'can override the TTY of the passed in class' do
31
- output = Output.new(TestNonTtyOutputClass.new, true)
32
-
33
- expect(output).to be_tty
34
- end
35
- end
36
- end
@@ -1,265 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'fuubar'
4
- require 'stringio'
5
- require 'ostruct'
6
-
7
- # rubocop:disable Metrics/LineLength
8
- describe Fuubar do
9
- let(:output) do
10
- io = StringIO.new
11
-
12
- allow(io).to receive(:tty?)
13
- .and_return(true)
14
-
15
- io
16
- end
17
-
18
- let(:formatter) { Fuubar.new(output) }
19
- let(:example) { self.class.example }
20
- let(:example_count) { 2 }
21
- let(:start_notification) { RSpec::Core::Notifications::StartNotification.new(example_count, Time.now) }
22
- let(:message_notification) { RSpec::Core::Notifications::MessageNotification.new('My Message') }
23
- let(:example_notification) { RSpec::Core::Notifications::ExampleNotification.for(example) }
24
- let(:pending_notification) { RSpec::Core::Notifications::ExampleNotification.for(pending_example) }
25
- let(:failed_notification) { RSpec::Core::Notifications::ExampleNotification.for(failed_example) }
26
-
27
- let(:failed_example) do
28
- exception = RuntimeError.new('Test Fuubar Error')
29
- exception.set_backtrace [
30
- "/my/filename.rb:4:in `some_method'",
31
- ]
32
-
33
- example = self.class.example
34
-
35
- example.metadata[:file_path] = '/my/example/spec.rb'
36
- example.metadata[:execution_result].status = :failed
37
- example.metadata[:execution_result].exception = exception
38
-
39
- example
40
- end
41
-
42
- let(:pending_example) do
43
- example = self.class.example
44
- example.metadata[:execution_result].pending_fixed = true
45
- example
46
- end
47
-
48
- let(:fuubar_results) do
49
- output.rewind
50
- output.read
51
- end
52
-
53
- before(:each) do
54
- RSpec.configuration.fuubar_progress_bar_options = {
55
- :length => 40,
56
- :throttle_rate => 0.0,
57
- }
58
-
59
- ENV.delete('CONTINUOUS_INTEGRATION')
60
- end
61
-
62
- context 'when it is created' do
63
- it 'does not start the bar until the formatter is started' do
64
- expect(formatter.progress).not_to be_started
65
-
66
- formatter.start(start_notification)
67
-
68
- expect(formatter.progress).to be_started
69
- end
70
-
71
- it 'creates a new ProgressBar' do
72
- expect(formatter.progress).to be_instance_of ProgressBar::Base
73
- end
74
-
75
- it 'sets the format of the bar to the default' do
76
- expect(formatter.progress.instance_variable_get(:@format)).to eql ' %c/%C |%w>%i| %e '
77
- end
78
-
79
- it 'sets the total to the number of examples' do
80
- expect(formatter.progress.total).to be_zero
81
- end
82
-
83
- it 'sets the bar\'s output' do
84
- expect(formatter.progress.send(:output).stream).to be_a Fuubar::Output
85
- expect(formatter.progress.send(:output).stream.__getobj__).to eql output
86
- end
87
-
88
- context 'and continuous integration is enabled' do
89
- before do
90
- RSpec.configuration.fuubar_progress_bar_options = { :length => 40 }
91
- ENV['CONTINUOUS_INTEGRATION'] = 'true'
92
- end
93
-
94
- it 'throttles the progress bar at one second' do
95
- throttle = formatter.progress.__send__(:output).__send__(:throttle)
96
- throttle_rate = throttle.__send__(:rate)
97
-
98
- expect(throttle_rate).to eql 1.0
99
- end
100
-
101
- context 'when processing an example' do
102
- before do
103
- formatter.start(start_notification)
104
-
105
- throttle = formatter.progress.__send__(:output).__send__(:throttle)
106
- _throttle_rate = throttle.__send__(:rate=, 0.0)
107
-
108
- output.rewind
109
-
110
- formatter.example_passed(example)
111
- end
112
-
113
- it 'does not output color codes' do
114
- expect(fuubar_results).to start_with " 1/2 |== 50 ==> | ETA: 00:00:00 \r"
115
- end
116
- end
117
- end
118
-
119
- context 'and continuous integration is not enabled' do
120
- before do
121
- RSpec.configuration.fuubar_progress_bar_options = { :length => 40 }
122
- ENV['CONTINUOUS_INTEGRATION'] = 'false'
123
- end
124
-
125
- it 'throttles the progress bar at the default rate' do
126
- throttle = formatter.progress.__send__(:output).__send__(:throttle)
127
- throttle_rate = throttle.__send__(:rate)
128
-
129
- expect(throttle_rate).to eql 0.01
130
- end
131
-
132
- context 'when processing an example' do
133
- before do
134
- formatter.start(start_notification)
135
-
136
- throttle = formatter.progress.__send__(:output).__send__(:throttle)
137
- _throttle_rate = throttle.__send__(:rate=, 0.0)
138
-
139
- output.rewind
140
-
141
- formatter.example_passed(example)
142
- end
143
-
144
- it 'does not output color codes' do
145
- expect(fuubar_results).to start_with "\e[32m 1/2 |== 50 ==> | ETA: 00:00:00 \r\e[0m"
146
- end
147
- end
148
- end
149
- end
150
-
151
- context 'when custom options are set after the formatter is created' do
152
- before(:each) do
153
- formatter
154
- RSpec.configuration.fuubar_progress_bar_options = {
155
- :length => 40,
156
- :throttle_rate => 0.0,
157
- :format => '%c',
158
- }
159
- end
160
-
161
- context 'when the bar is started' do
162
- before(:each) { formatter.start(start_notification) }
163
-
164
- it 'properly creates the bar' do
165
- expect(formatter.progress.instance_variable_get(:@format)).to eql '%c'
166
- end
167
- end
168
- end
169
-
170
- context 'when it is started' do
171
- before { formatter.start(start_notification) }
172
-
173
- it 'sets the total to the number of examples' do
174
- expect(formatter.progress.total).to eql 2
175
- end
176
-
177
- context 'and no custom options are passed in' do
178
- it 'sets the format of the bar to the default' do
179
- expect(formatter.progress.instance_variable_get(:@format)).to eql ' %c/%C |%w>%i| %e '
180
- end
181
- end
182
-
183
- context 'and an example passes' do
184
- before do
185
- output.rewind
186
-
187
- formatter.example_passed(example)
188
- end
189
-
190
- it 'outputs the proper bar information' do
191
- expect(fuubar_results).to start_with "\e[32m 1/2 |== 50 ==> | ETA: 00:00:00 \r\e[0m"
192
- end
193
- end
194
-
195
- context 'and an example pends' do
196
- before do
197
- output.rewind
198
-
199
- formatter.example_pending(pending_example)
200
- end
201
-
202
- it 'outputs the proper bar information' do
203
- formatter.progress.increment
204
- expect(fuubar_results).to start_with "\e[33m 1/2 |== 50 ==> | ETA: 00:00:00 \r\e[0m"
205
- end
206
-
207
- context 'and then an example succeeds' do
208
- before do
209
- output.rewind
210
-
211
- formatter.example_pending(pending_notification)
212
- end
213
-
214
- it 'outputs the pending bar' do
215
- expect(fuubar_results).to start_with "\e[33m 2/2 |===== 100 ======>| Time: 00:00:00 \n\e[0m"
216
- end
217
- end
218
- end
219
-
220
- context 'and an example fails' do
221
- it 'outputs the proper bar information' do
222
- output.rewind
223
-
224
- formatter.example_failed(failed_notification)
225
-
226
- expect(fuubar_results).to end_with "\e[31m 1/2 |== 50 ==> | ETA: 00:00:00 \r\e[0m"
227
- end
228
-
229
- context 'and then an example succeeds' do
230
- before do
231
- formatter.example_failed(failed_notification)
232
-
233
- output.rewind
234
-
235
- formatter.example_passed(example)
236
- end
237
-
238
- it 'outputs the failed bar' do
239
- expect(fuubar_results).to start_with "\e[31m 2/2 |===== 100 ======>| Time: 00:00:00 \n\e[0m"
240
- end
241
- end
242
-
243
- context 'and then an example pends' do
244
- before do
245
- formatter.example_failed(failed_notification)
246
-
247
- output.rewind
248
-
249
- formatter.example_pending(example_notification)
250
- end
251
-
252
- it 'outputs the failed bar' do
253
- expect(fuubar_results).to start_with "\e[31m 2/2 |===== 100 ======>| Time: 00:00:00 \n\e[0m"
254
- end
255
- end
256
- end
257
-
258
- it 'can properly log messages' do
259
- formatter.message message_notification
260
-
261
- expect(fuubar_results).to end_with "My Message\n 0/2 |> | ETA: ??:??:?? \r"
262
- end
263
- end
264
- end
265
- # rubocop:enable Metrics/LineLength