fuubar 2.3.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +4 -3
- data/LICENSE.txt +1 -1
- data/README.md +173 -57
- data/lib/fuubar.rb +54 -45
- data/lib/fuubar/output.rb +2 -2
- metadata +40 -64
- metadata.gz.sig +0 -0
- data/spec/fuubar/output_spec.rb +0 -36
- data/spec/fuubar_spec.rb +0 -265
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1fd1a2c4590312a74d9626c64fc2ddd353ff5ebd351a74e3643087646c60462a
|
4
|
+
data.tar.gz: 46a97b176a9c504e0f20553a94f304be2bb97b171258e7350c5d460ff6d83fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8545ad87bb3cf36a508feaa26f3d5cdbb82bf362187dd7fc522c92255d9b8456a98a436dc6da6288568655842567bd132b2418aab297d410b41e92404a7da194
|
7
|
+
data.tar.gz: ea0f79a6c37344dabf5bbbd23d273148856bd5e4220af3785155a7f9a748f3314eee8391f37f4c5c615f0f7ae5b90e4b360f0eb4a09fd13aae5bc247800a0242
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
+���s��͡��,���̴�1�-2o)#�2頯�Z���t��%�س�3ߟ�|�E$G��LISE͡�7�
|
2
|
+
;�VőON�����b$51Mw�{��C�5����n10H�q���I���s٤g�CV�<�g�1�.-|�sa�N��� W��m�'V3�|>d&�y�����a�P��6�w��r�} �0�NU���qF�v�xpe#J�����bY⋙N�p�6F��*@��sS�:W]Q1k|֏Rdz�̒sk
|
3
|
+
�;��
|
4
|
+
l�[�p��K�ҹ���3g�!�;�t�E�L4������{����A����U]���iYd���O���Ϊ+;��J���T��l
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,108 +1,224 @@
|
|
1
|
-
|
1
|
+
Fuubar
|
2
|
+
================================================================================
|
2
3
|
|
3
|
-
|
4
|
+
<div align="center">
|
5
|
+
<a href="https://rubygems.org/gems/fuubar" alt="RubyGems Version">
|
6
|
+
<img src="https://img.shields.io/gem/v/fuubar.svg?style=flat-square&label=current-version" alt="RubyGems Version" />
|
7
|
+
</a>
|
4
8
|
|
5
|
-
|
9
|
+
<a href="https://rubygems.org/gems/fuubar" alt="RubyGems Rank Overall">
|
10
|
+
<img src="https://img.shields.io/gem/rt/fuubar.svg?style=flat-square&label=total-rank" alt="RubyGems Rank Overall" />
|
11
|
+
</a>
|
6
12
|
|
7
|
-
|
13
|
+
<a href="https://rubygems.org/gems/fuubar" alt="RubyGems Rank Daily">
|
14
|
+
<img src="https://img.shields.io/gem/rd/fuubar.svg?style=flat-square&label=daily-rank" alt="RubyGems Rank Daily" />
|
15
|
+
</a>
|
8
16
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
<a href="https://rubygems.org/gems/fuubar" alt="RubyGems Downloads">
|
18
|
+
<img src="https://img.shields.io/gem/dt/fuubar.svg?style=flat-square&label=total-downloads" alt="RubyGems Downloads" />
|
19
|
+
</a>
|
20
|
+
|
21
|
+
<a href="https://github.com/thekompanee/fuubar/actions?query=workflow%3ABuild" alt="Build Status">
|
22
|
+
<img src="https://img.shields.io/github/workflow/status/jfelchner/fuubar/Build?label=CI&style=flat-square&logo=github" alt="Build Status" />
|
23
|
+
</a>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<br>
|
27
|
+
|
28
|
+
fuubar is an instafailing [RSpec][rspec] formatter that uses
|
29
|
+
a progress bar instead of a string of letters and dots as feedback.
|
30
|
+
|
31
|
+
![examples][example-gif]
|
21
32
|
|
22
33
|
Installation
|
23
34
|
--------------------------------------------------------------------------------
|
24
35
|
|
25
|
-
First:
|
26
|
-
|
27
36
|
```ruby
|
28
37
|
gem install fuubar
|
29
|
-
```
|
30
38
|
|
31
|
-
or in your Gemfile
|
39
|
+
# or in your Gemfile
|
32
40
|
|
33
|
-
```ruby
|
34
41
|
gem 'fuubar'
|
35
42
|
```
|
36
43
|
|
37
|
-
|
44
|
+
Usage
|
45
|
+
--------------------------------------------------------------------------------
|
46
|
+
|
47
|
+
In order to use fuubar, you have three options.
|
48
|
+
|
49
|
+
### Option 1: Invoke It Manually Via The Command Line
|
38
50
|
|
51
|
+
```bash
|
52
|
+
rspec --format Fuubar --color
|
39
53
|
```
|
40
|
-
|
54
|
+
|
55
|
+
### Option 2: Add It To Your Local `.rspec` File
|
56
|
+
|
57
|
+
```text
|
58
|
+
# .rspec
|
59
|
+
|
60
|
+
--format Fuubar
|
61
|
+
--color
|
41
62
|
```
|
42
63
|
|
43
|
-
|
64
|
+
### Option 3: Add It To Your `spec_helper.rb`
|
44
65
|
|
45
|
-
|
46
|
-
|
66
|
+
```ruby
|
67
|
+
# spec/spec_helper.rb
|
47
68
|
|
48
|
-
|
49
|
-
|
69
|
+
RSpec.configure do |config|
|
70
|
+
config.add_formatter 'Fuubar'
|
71
|
+
end
|
72
|
+
```
|
50
73
|
|
51
|
-
|
52
|
-
|
74
|
+
Advanced Usage
|
75
|
+
--------------------------------
|
53
76
|
|
54
|
-
|
77
|
+
### Customizing The Bar
|
78
|
+
|
79
|
+
fuubar exposes an RSpec configuration variable called
|
80
|
+
`fuubar_progress_bar_options` which, when set will be passed directly to
|
81
|
+
[ruby-progressbar][rpb-github] which does all the heavy lifting. Take a look at
|
82
|
+
the [ruby-progressbar documentation][rpb-docs] for details on all of the options
|
83
|
+
you can pass in.
|
84
|
+
|
85
|
+
#### Example
|
86
|
+
|
87
|
+
Let's say for example that you would like to change the format of the bar. You
|
88
|
+
would do that like so:
|
55
89
|
|
90
|
+
```ruby
|
91
|
+
# spec/spec_helper.rb
|
92
|
+
|
93
|
+
RSpec.configure do |config|
|
94
|
+
config.fuubar_progress_bar_options = { :format => 'My Fuubar! <%B> %p%% %a' }
|
95
|
+
end
|
56
96
|
```
|
57
|
-
|
97
|
+
|
98
|
+
would make it so that, when fuubar is output, it would look something like:
|
99
|
+
|
100
|
+
```text
|
101
|
+
My Fuubar! <================================ > 53.44% 00:12:31
|
58
102
|
```
|
59
103
|
|
60
|
-
|
104
|
+
### Hiding Pending/Skipped Spec Summary
|
61
105
|
|
62
|
-
|
63
|
-
|
106
|
+
By default fuubar follows RSpec's lead and will dump out a summary of all of the
|
107
|
+
pending specs in the suite once the test run is over. This is a good idea
|
108
|
+
because the additional noise is a nudge to fix those tests. We realize however
|
109
|
+
that not all teams have the luxury of implementing all of the pending specs and
|
110
|
+
therefore fuubar gives you the option of supressing that summary.
|
64
111
|
|
65
|
-
|
66
|
-
isn't signed, so we cannot use `HighSecurity`.
|
112
|
+
#### Example
|
67
113
|
|
68
|
-
|
69
|
-
|
114
|
+
```ruby
|
115
|
+
# spec/spec_helper.rb
|
70
116
|
|
71
|
-
|
117
|
+
RSpec.configure do |config|
|
118
|
+
config.fuubar_output_pending_results = false
|
119
|
+
end
|
120
|
+
```
|
72
121
|
|
73
|
-
|
122
|
+
### Enabling Auto-Refresh
|
74
123
|
|
75
|
-
|
124
|
+
By default fuubar refreshes the bar only between each spec.
|
125
|
+
You can enable an auto-refresh feature that will keep refreshing the bar (and
|
126
|
+
therefore the ETA) every second.
|
127
|
+
You can enable the feature as follows:
|
76
128
|
|
77
129
|
```ruby
|
78
|
-
# spec_helper.rb
|
130
|
+
# spec/spec_helper.rb
|
79
131
|
|
80
132
|
RSpec.configure do |config|
|
81
|
-
config.
|
133
|
+
config.fuubar_auto_refresh = true
|
82
134
|
end
|
83
135
|
```
|
84
136
|
|
85
|
-
|
137
|
+
#### Undesirable Effects
|
86
138
|
|
87
|
-
|
139
|
+
Unfortunately this option doesn't play well with things like debuggers, as
|
140
|
+
having a bar show up every second would be undesireable (which is why the
|
141
|
+
feature is disabled by default). Depending on what you are using, you may be
|
142
|
+
given ways to work around this problem.
|
88
143
|
|
89
|
-
|
90
|
-
--------------------------------
|
144
|
+
##### Pry
|
91
145
|
|
92
|
-
|
146
|
+
[Pry][pry] provides hooks that can be used to disable fuubar during a debugging
|
147
|
+
session, you could for example add the following to your spec helper:
|
93
148
|
|
94
|
-
|
95
|
-
|
149
|
+
```ruby
|
150
|
+
# spec/spec_helper.rb
|
96
151
|
|
97
|
-
|
98
|
-
|
152
|
+
Pry.config.hooks.add_hook(:before_session, :disable_fuubar_auto_refresh) do |_output, _binding, _pry|
|
153
|
+
RSpec.configuration.fuubar_auto_refresh = false
|
154
|
+
end
|
155
|
+
|
156
|
+
Pry.config.hooks.add_hook(:after_session, :restore_fuubar_auto_refresh) do |_output, _binding, _pry|
|
157
|
+
RSpec.configuration.fuubar_auto_refresh = true
|
158
|
+
end
|
159
|
+
```
|
160
|
+
|
161
|
+
##### Byebug
|
162
|
+
|
163
|
+
Unfortunately [byebug][byebug] does not provide hooks, so your best bet is to
|
164
|
+
disable auto-refresh manually before calling `byebug`.
|
165
|
+
|
166
|
+
```ruby
|
167
|
+
RSpec.configuration.fuubar_auto_refresh = false
|
168
|
+
byebug
|
169
|
+
```
|
99
170
|
|
100
|
-
|
171
|
+
Security
|
101
172
|
--------------------------------------------------------------------------------
|
102
173
|
|
103
|
-
|
174
|
+
fuubar is cryptographically signed. To be sure the gem you install hasn’t been
|
175
|
+
tampered with, follow these steps:
|
176
|
+
|
177
|
+
* Add my public key (if you haven’t already) as a trusted certificate
|
178
|
+
|
179
|
+
```bash
|
180
|
+
gem cert --add <(curl -Ls https://raw.github.com/thekompanee/fuubar/master/certs/thekompanee.pem)
|
181
|
+
```
|
182
|
+
|
183
|
+
* Install fuubar telling it to use security checks when possible.
|
184
|
+
|
185
|
+
```bash
|
186
|
+
gem install fuubar -P MediumSecurity
|
187
|
+
```
|
188
|
+
|
189
|
+
> **Note:** The `MediumSecurity` trust profile will verify signed gems, but
|
190
|
+
> allow the installation of unsigned dependencies.
|
191
|
+
>
|
192
|
+
> This is necessary because fuubar has a dependency on RSpec which isn't signed,
|
193
|
+
> and therefore we cannot use `HighSecurity`, which requires signed gems.
|
194
|
+
|
195
|
+
Credits
|
196
|
+
--------------------------------------------------------------------------------
|
197
|
+
|
198
|
+
fuubar was written by [Jeff Felchner][jefff-profile] and [Jeff
|
199
|
+
Kreeftmeijer][jeffk-profile]
|
200
|
+
|
201
|
+
![The Kompanee][kompanee-logo]
|
202
|
+
|
203
|
+
fuubar is maintained and funded by [The Kompanee, Ltd.][kompanee-site]
|
204
|
+
|
205
|
+
The names and logos for The Kompanee are trademarks of The Kompanee, Ltd.
|
104
206
|
|
105
207
|
License
|
106
|
-
|
208
|
+
--------------------------------------------------------------------------------
|
107
209
|
|
108
|
-
fuubar is Copyright © 2010-
|
210
|
+
fuubar is Copyright © 2010-2021 Jeff Kreeftmeijer and Jeff Felchner. It is
|
211
|
+
free software, and may be redistributed under the terms specified in the
|
212
|
+
[LICENSE][license] file.
|
213
|
+
|
214
|
+
[byebug]: https://github.com/deivid-rodriguez/byebug
|
215
|
+
[example-gif]: https://kompanee-public-assets.s3.amazonaws.com/readmes/fuubar-examples.gif
|
216
|
+
[jefff-profile]: https://github.com/jfelchner
|
217
|
+
[jeffk-profile]: https://github.com/jeffkreeftmeijer
|
218
|
+
[kompanee-logo]: https://kompanee-public-assets.s3.amazonaws.com/readmes/kompanee-horizontal-black.png
|
219
|
+
[kompanee-site]: http://www.thekompanee.com
|
220
|
+
[license]: https://github.com/thekompanee/fuubar/blob/master/LICENSE.txt
|
221
|
+
[pry]: https://github.com/pry/pry
|
222
|
+
[rpb-docs]: https://github.com/jfelchner/ruby-progressbar/wiki/Options
|
223
|
+
[rpb-github]: https://github.com/jfelchner/ruby-progressbar
|
224
|
+
[rspec]: https://github.com/rspec
|
data/lib/fuubar.rb
CHANGED
@@ -5,22 +5,24 @@ require 'rspec/core/formatters/base_text_formatter'
|
|
5
5
|
require 'ruby-progressbar'
|
6
6
|
require 'fuubar/output'
|
7
7
|
|
8
|
-
RSpec.configuration.add_setting :fuubar_progress_bar_options,
|
8
|
+
::RSpec.configuration.add_setting :fuubar_progress_bar_options, :default => {}
|
9
|
+
::RSpec.configuration.add_setting :fuubar_auto_refresh, :default => false
|
10
|
+
::RSpec.configuration.add_setting :fuubar_output_pending_results, :default => true
|
9
11
|
|
10
|
-
class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
12
|
+
class Fuubar < ::RSpec::Core::Formatters::BaseTextFormatter
|
11
13
|
DEFAULT_PROGRESS_BAR_OPTIONS = { :format => ' %c/%C |%w>%i| %e ' }.freeze
|
12
14
|
|
13
|
-
RSpec::Core::Formatters.register self,
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
::RSpec::Core::Formatters.register self,
|
16
|
+
:close,
|
17
|
+
:dump_failures,
|
18
|
+
:dump_pending,
|
19
|
+
:example_failed,
|
20
|
+
:example_passed,
|
21
|
+
:example_pending,
|
22
|
+
:message,
|
23
|
+
:start
|
24
|
+
|
25
|
+
attr_accessor :example_tick_lock,
|
24
26
|
:progress,
|
25
27
|
:passed_count,
|
26
28
|
:pending_count,
|
@@ -29,29 +31,28 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
|
29
31
|
def initialize(*args)
|
30
32
|
super
|
31
33
|
|
32
|
-
self.example_tick_lock = Mutex.new
|
33
|
-
self.progress = ProgressBar.create(
|
34
|
-
DEFAULT_PROGRESS_BAR_OPTIONS
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
self.example_tick_lock = ::Mutex.new
|
35
|
+
self.progress = ::ProgressBar.create(
|
36
|
+
DEFAULT_PROGRESS_BAR_OPTIONS.
|
37
|
+
merge(:throttle_rate => continuous_integration? ? 1.0 : nil).
|
38
|
+
merge(:total => 0,
|
39
|
+
:output => output,
|
40
|
+
:autostart => false)
|
39
41
|
)
|
40
42
|
end
|
41
43
|
|
42
44
|
def start(notification)
|
43
|
-
progress_bar_options = DEFAULT_PROGRESS_BAR_OPTIONS
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
self.progress
|
51
|
-
self.passed_count
|
52
|
-
self.pending_count
|
53
|
-
self.failed_count
|
54
|
-
self.example_tick_thread = start_tick_thread(notification)
|
45
|
+
progress_bar_options = DEFAULT_PROGRESS_BAR_OPTIONS.
|
46
|
+
merge(:throttle_rate => continuous_integration? ? 1.0 : nil).
|
47
|
+
merge(configuration.fuubar_progress_bar_options).
|
48
|
+
merge(:total => notification.count,
|
49
|
+
:output => output,
|
50
|
+
:autostart => false)
|
51
|
+
|
52
|
+
self.progress = ::ProgressBar.create(progress_bar_options)
|
53
|
+
self.passed_count = 0
|
54
|
+
self.pending_count = 0
|
55
|
+
self.failed_count = 0
|
55
56
|
|
56
57
|
super
|
57
58
|
|
@@ -91,6 +92,18 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
|
91
92
|
end
|
92
93
|
end
|
93
94
|
|
95
|
+
def example_tick_thread
|
96
|
+
::Thread.new do
|
97
|
+
loop do
|
98
|
+
sleep(1)
|
99
|
+
|
100
|
+
if configuration.fuubar_auto_refresh
|
101
|
+
example_tick(notification)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
94
107
|
def message(notification)
|
95
108
|
if progress.respond_to? :log
|
96
109
|
progress.log(notification.message)
|
@@ -106,8 +119,14 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
|
106
119
|
#
|
107
120
|
end
|
108
121
|
|
122
|
+
def dump_pending(notification)
|
123
|
+
return unless configuration.fuubar_output_pending_results
|
124
|
+
|
125
|
+
super
|
126
|
+
end
|
127
|
+
|
109
128
|
def output
|
110
|
-
@fuubar_output ||= Fuubar::Output.new(super, configuration.tty?)
|
129
|
+
@fuubar_output ||= ::Fuubar::Output.new(super, configuration.tty?) # rubocop:disable Naming/MemoizedInstanceVariableName
|
111
130
|
end
|
112
131
|
|
113
132
|
private
|
@@ -141,25 +160,15 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
|
141
160
|
end
|
142
161
|
|
143
162
|
def color_code_for(*args)
|
144
|
-
RSpec::Core::Formatters::ConsoleCodes.console_code_for(*args)
|
163
|
+
::RSpec::Core::Formatters::ConsoleCodes.console_code_for(*args)
|
145
164
|
end
|
146
165
|
|
147
166
|
def configuration
|
148
|
-
RSpec.configuration
|
167
|
+
::RSpec.configuration
|
149
168
|
end
|
150
169
|
|
151
170
|
def continuous_integration?
|
152
171
|
@continuous_integration ||= \
|
153
172
|
![nil, '', 'false'].include?(ENV['CONTINUOUS_INTEGRATION'])
|
154
173
|
end
|
155
|
-
|
156
|
-
def start_tick_thread(notification)
|
157
|
-
Thread.new do
|
158
|
-
loop do
|
159
|
-
sleep(1)
|
160
|
-
|
161
|
-
example_tick(notification)
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
165
174
|
end
|
data/lib/fuubar/output.rb
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'delegate'
|
4
4
|
|
5
|
-
class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
5
|
+
class Fuubar < ::RSpec::Core::Formatters::BaseTextFormatter
|
6
6
|
class Output < ::Delegator
|
7
|
-
def initialize(output, force_tty = false)
|
7
|
+
def initialize(output, force_tty = false) # rubocop:disable Style/OptionalBooleanParameter, Lint/MissingSuper
|
8
8
|
@raw_output = output
|
9
9
|
@force_tty = force_tty
|
10
10
|
end
|
metadata
CHANGED
@@ -1,39 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuubar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Evans
|
8
8
|
- Jeff Kreeftmeijer
|
9
9
|
- jfelchner
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain:
|
13
13
|
- |
|
14
14
|
-----BEGIN CERTIFICATE-----
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
15
|
+
MIIEGDCCAoCgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAyMTAwLgYDVQQDDCdhY2Nv
|
16
|
+
dW50c19ydWJ5Z2Vtcy9EQz10aGVrb21wYW5lZS9EQz1jb20wHhcNMjAxMjI2MjIy
|
17
|
+
NTE5WhcNMjExMjI2MjIyNTE5WjAyMTAwLgYDVQQDDCdhY2NvdW50c19ydWJ5Z2Vt
|
18
|
+
cy9EQz10aGVrb21wYW5lZS9EQz1jb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAw
|
19
|
+
ggGKAoIBgQD0Z84PxtE0iiWCMTQbnit6D4w55GGBQZnhpWUCJwC0SpQ/jnT0Fsma
|
20
|
+
g8oAIdDclLvLC9jzqSAmkOujlpkJMb5NabgkhKFwHi6cVW/gz/cVnISAv8LQTIM5
|
21
|
+
c1wyhwX/YhVFaNYNzMizB//kZOeXnv6x0tqV9NY7urHcT6mCwyLeNJIgf44i1Ut+
|
22
|
+
mKtXxEyXNbfWQLVY95bVoVg3GOCkycerZN4Oh3zSJM1s+cZRBFlg7GR1AE3Xqs6k
|
23
|
+
RhE7yp8ufeghC3bbxgnQrkk8W8Fkkl0/+2JAENpdE4OUepC6dFzDlLZ3UvSk7VHf
|
24
|
+
NBRKSuO15kpPo2G55N0HLy8abUzbu5cqjhSbIk9hzD6AmdGCT4DqlsdHI5gOrGP0
|
25
|
+
BO6VxGpRuRETKoZ4epPCsXC2XAwk3TJXkuuqYkgdcv8ZR4rPW2CiPvRqgG1YVwWj
|
26
|
+
SrIy5Dt/dlMvxdIMiTj6ytAQP1kfdKPFWrJTIA2tspl/eNB+LiYsVdj8d0UU/KTY
|
27
|
+
y7jqKMpOE1UCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
28
|
+
BBYEFO/l0LjdONn2Rr8y4WGyMA37MWVfMA0GCSqGSIb3DQEBCwUAA4IBgQDBGn+T
|
29
|
+
HS7SCuLgjCimsT5e3v+Q0VaML1+yJPPqvIVM+HMyTYDpV2ogdAcX1I0lNbUHT9w7
|
30
|
+
5y8pQ7BtYq8LDX6D8EufjvlgpJzunuPpNVh2QQdtkYC2zGabTnk+BJC5scYckBxW
|
31
|
+
PxYXSuOxjXAkFe1r9RhPzeMY8lPVh6aEQKNLVkzbpIjoGzUgAPGPZG/ylKSWycwE
|
32
|
+
qfHiDXzCAqMzSsb3sMQO1+0euciY1oTOyYCHYKo+gemWEI/p8PyJe/qB2tWC9GYs
|
33
|
+
m+we5ul7O4Sq8qKnX0KCqHneqaXakcbuEkhViW6Def432jH8JjYums6EW2mg9570
|
34
|
+
pHS20TH4u9o0+5DIhayfGrmAtdtQutQNCclONqBlk7r3/16Y8Lr376dDHrISZlwd
|
35
|
+
fdbUKgJXqJeb4GYhiKV07l67XExVjmAklMuA6bcB7mk+aSYUkoWNic4ZYGNjVv88
|
36
|
+
AapqLKNG/UPfrJhdhTtFR4ARb8f54rgzONhTaAqVk23Bdp1yoDXaulFCkmU=
|
35
37
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
38
|
+
date: 2020-12-31 00:00:00.000000000 Z
|
37
39
|
dependencies:
|
38
40
|
- !ruby/object:Gem::Dependency
|
39
41
|
name: rspec-core
|
@@ -69,44 +71,18 @@ dependencies:
|
|
69
71
|
requirements:
|
70
72
|
- - "~>"
|
71
73
|
- !ruby/object:Gem::Version
|
72
|
-
version: '3.
|
73
|
-
type: :development
|
74
|
-
prerelease: false
|
75
|
-
version_requirements: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
77
|
-
- - "~>"
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '3.0'
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
|
-
name: chamber
|
82
|
-
requirement: !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - "~>"
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '2.3'
|
87
|
-
type: :development
|
88
|
-
prerelease: false
|
89
|
-
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
requirements:
|
91
|
-
- - "~>"
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '2.3'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: awesome_print
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
requirements:
|
98
|
-
- - "~>"
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: '1.7'
|
74
|
+
version: '3.7'
|
101
75
|
type: :development
|
102
76
|
prerelease: false
|
103
77
|
version_requirements: !ruby/object:Gem::Requirement
|
104
78
|
requirements:
|
105
79
|
- - "~>"
|
106
80
|
- !ruby/object:Gem::Version
|
107
|
-
version: '
|
81
|
+
version: '3.7'
|
108
82
|
description: the instafailing RSpec progress bar formatter
|
109
|
-
email:
|
83
|
+
email:
|
84
|
+
- jeff@kreeftmeijer.nl
|
85
|
+
- accounts+git@thekompanee.com
|
110
86
|
executables: []
|
111
87
|
extensions: []
|
112
88
|
extra_rdoc_files: []
|
@@ -115,14 +91,17 @@ files:
|
|
115
91
|
- README.md
|
116
92
|
- lib/fuubar.rb
|
117
93
|
- lib/fuubar/output.rb
|
118
|
-
- spec/fuubar/output_spec.rb
|
119
|
-
- spec/fuubar_spec.rb
|
120
94
|
homepage: https://github.com/thekompanee/fuubar
|
121
95
|
licenses:
|
122
96
|
- MIT
|
123
97
|
metadata:
|
124
|
-
|
125
|
-
|
98
|
+
bug_tracker_uri: https://github.com/thekompanee/fuubar/issues
|
99
|
+
changelog_uri: https://github.com/thekompanee/fuubar/blob/master/CHANGELOG.md
|
100
|
+
documentation_uri: https://github.com/thekompanee/fuubar/tree/releases/v2.4.0
|
101
|
+
homepage_uri: https://github.com/thekompanee/fuubar
|
102
|
+
source_code_uri: https://github.com/thekompanee/fuubar
|
103
|
+
wiki_uri: https://github.com/thekompanee/fuubar/wiki
|
104
|
+
post_install_message:
|
126
105
|
rdoc_options: []
|
127
106
|
require_paths:
|
128
107
|
- lib
|
@@ -137,11 +116,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
116
|
- !ruby/object:Gem::Version
|
138
117
|
version: '0'
|
139
118
|
requirements: []
|
140
|
-
|
141
|
-
|
142
|
-
signing_key:
|
119
|
+
rubygems_version: 3.2.3
|
120
|
+
signing_key:
|
143
121
|
specification_version: 4
|
144
122
|
summary: the instafailing RSpec progress bar formatter
|
145
|
-
test_files:
|
146
|
-
- spec/fuubar/output_spec.rb
|
147
|
-
- spec/fuubar_spec.rb
|
123
|
+
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|
data/spec/fuubar/output_spec.rb
DELETED
@@ -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
|
data/spec/fuubar_spec.rb
DELETED
@@ -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
|