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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f45e83d8ece31b53d814e68c23b22c4289f8d335
4
- data.tar.gz: 5bb74d0273a67d87a5ca936a0fc8edc59c3bf454
2
+ SHA256:
3
+ metadata.gz: 1fd1a2c4590312a74d9626c64fc2ddd353ff5ebd351a74e3643087646c60462a
4
+ data.tar.gz: 46a97b176a9c504e0f20553a94f304be2bb97b171258e7350c5d460ff6d83fb8
5
5
  SHA512:
6
- metadata.gz: 040c146dfa98c6110c45595161910ee05a3b886a4dab17fb7d4f652abc6f7f5b9a5b5aea2dc8baf02f5fb8dc25dd749fff5dc81a261cf6689338dff8dabf616c
7
- data.tar.gz: 5963747ef4677a38ec5bac983e317e155973cb8b9a64fd12c409e1445247f429b870fa79421140b3e9af4d130aa55f25609dd7a0a88cc574ae4516ebd0f6bfed
6
+ metadata.gz: 8545ad87bb3cf36a508feaa26f3d5cdbb82bf362187dd7fc522c92255d9b8456a98a436dc6da6288568655842567bd132b2418aab297d410b41e92404a7da194
7
+ data.tar.gz: ea0f79a6c37344dabf5bbbd23d273148856bd5e4220af3785155a7f9a748f3314eee8391f37f4c5c615f0f7ae5b90e4b360f0eb4a09fd13aae5bc247800a0242
Binary file
data.tar.gz.sig CHANGED
@@ -1,3 +1,4 @@
1
- �B�M��.�WB�_(����/��!Xis
2
- ?���[��2��"���^f�ɑ���Ֆo�����t��a��w��IFh��I4����Y�|�& Z�W��iI��k
3
- ���6n� �jS�+�A6�J��.� �h��-���%C1˯��X��m�j����l�X�tKJw5P0��J A1��(T�=�}?���5�dg>�r.8D�HKTv:J�8AԂ�7��|:�mӽyԁE=�CV�.�����R�ݖ�Qh�5
1
+ +���s��͡��,���̴�1�-2o)#�2頯�Z��� t��%�س�3ߟ�|�E$G��LIS E͡�7
2
+ ;�VőON�����b$51Mw�{��C�5����n10H�q���I���s٤g�CV�<�g�1�.-|�sa�N��� W��m�'V 3�|>d&�y�����a�P��6�w ��r�} �0NU���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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2016 The Kompanee, Ltd
1
+ Copyright (c) 2010-2019 The Kompanee, Ltd
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,108 +1,224 @@
1
- #Fuubar
1
+ Fuubar
2
+ ================================================================================
2
3
 
3
- [![Gem Version](https://img.shields.io/gem/v/fuubar.svg)](https://rubygems.org/gems/fuubar) ![Rubygems Rank Overall](https://img.shields.io/gem/rt/fuubar.svg) ![Rubygems Rank Daily](https://img.shields.io/gem/rd/fuubar.svg) ![Rubygems Downloads](https://img.shields.io/gem/dv/fuubar/stable.svg) [![Build Status](https://img.shields.io/travis/thekompanee/fuubar/master.svg)](http://travis-ci.org/thekompanee/fuubar) [![Code Climate](https://codeclimate.com/github/thekompanee/fuubar.svg)](https://codeclimate.com/github/thekompanee/fuubar)
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
- Fuubar is an instafailing [RSpec](http://github.com/rspec) formatter that uses a progress bar instead of a string of letters and dots as feedback.
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
- [![gif](http://i.imgur.com/GIiA53s.gif)](http://vimeo.com/16845253).
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
- Supported Rubies
10
- --------------------------------
11
- * MRI Ruby 1.8.7
12
- * MRI Ruby 1.9.2
13
- * MRI Ruby 1.9.3
14
- * MRI Ruby 2.0.x
15
- * MRI Ruby 2.1.x
16
- * MRI Ruby 2.2.x
17
- * MRI Ruby 2.3.x
18
- * MRI Ruby 2.4.x
19
- * JRuby (in 1.8 compat mode)
20
- * JRuby (in 1.9 compat mode)
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
- Then, when running rspec:
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
- rspec --format Fuubar --color spec
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
- Or, if you want to use Fuubar as your default formatter, simply put the options in your `.rspec` file:
64
+ ### Option 3: Add It To Your `spec_helper.rb`
44
65
 
45
- --format Fuubar
46
- --color
66
+ ```ruby
67
+ # spec/spec_helper.rb
47
68
 
48
- Security
49
- --------------------------------------------------------------------------------
69
+ RSpec.configure do |config|
70
+ config.add_formatter 'Fuubar'
71
+ end
72
+ ```
50
73
 
51
- fuubar is cryptographically signed. To be sure the gem you install hasn’t been
52
- tampered with:
74
+ Advanced Usage
75
+ --------------------------------
53
76
 
54
- * Add my public key (if you haven’t already) as a trusted certificate
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
- gem cert --add <(curl -Ls https://raw.github.com/thekompanee/fuubar/master/certs/thekompanee.pem)
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
- * gem install fuubar -P MediumSecurity
104
+ ### Hiding Pending/Skipped Spec Summary
61
105
 
62
- The `MediumSecurity` trust profile will verify signed gems, but allow the
63
- installation of unsigned dependencies.
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
- This is necessary because not all of fuubar has a dependency on RSpec which
66
- isn't signed, so we cannot use `HighSecurity`.
112
+ #### Example
67
113
 
68
- Advanced Usage
69
- --------------------------------
114
+ ```ruby
115
+ # spec/spec_helper.rb
70
116
 
71
- ### Customizing the Bar ###
117
+ RSpec.configure do |config|
118
+ config.fuubar_output_pending_results = false
119
+ end
120
+ ```
72
121
 
73
- Fuubar exposes an RSpec configuration variable called `fuubar_progress_bar_options` which, when set will be passed directly to [ruby-progressbar](https://github.com/jfelchner/ruby-progressbar) which does all the heavy lifting. Take a look at the documentation for details on all of the options you can pass in.
122
+ ### Enabling Auto-Refresh
74
123
 
75
- Let's say for example that you would like to change the format of the bar. You would do that like so:
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.fuubar_progress_bar_options = { :format => 'My Fuubar! <%B> %p%% %a' }
133
+ config.fuubar_auto_refresh = true
82
134
  end
83
135
  ```
84
136
 
85
- would make it so that, when Fuubar is output, it would look something like:
137
+ #### Undesirable Effects
86
138
 
87
- My Fuubar! <================================ > 53.44% 00:12:31
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
- Issues
90
- --------------------------------
144
+ ##### Pry
91
145
 
92
- If you have problems, please create a [Github issue](https://github.com/jeffkreeftmeijer/fuubar/issues).
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
- Credits
95
- --------------------------------
149
+ ```ruby
150
+ # spec/spec_helper.rb
96
151
 
97
- fuubar was created by [Jeff Kreeftmeijer](https://github.com/jeffkreeftmeijer)
98
- fuubar is maintained by [Jeff Kreeftmeijer](https://github.com/jeffkreeftmeijer) and [The Kompanee, Ltd.](http://www.thekompanee.com)
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
- Contributing
171
+ Security
101
172
  --------------------------------------------------------------------------------
102
173
 
103
- Found an issue? Have a great idea? Want to help? Great! Create an issue [issue](http://github.com/jeffkreeftmeijer/fuubar/issues) for it, or even better; fork the project and fix the problem yourself. Pull requests are always welcome. :)
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 &copy; 2010-2016 Jeff Kreeftmeijer and Jeff Felchner. It is free software, and may be redistributed under the terms specified in the LICENSE file.
210
+ fuubar is Copyright &copy; 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
@@ -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, :default => {}
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
- :close,
15
- :dump_failures,
16
- :example_failed,
17
- :example_passed,
18
- :example_pending,
19
- :message,
20
- :start
21
-
22
- attr_accessor :example_tick_thread,
23
- :example_tick_lock,
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
- .merge(:throttle_rate => continuous_integration? ? 1.0 : nil)
36
- .merge(:total => 0,
37
- :output => output,
38
- :autostart => false)
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
- .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
-
50
- self.progress = ProgressBar.create(progress_bar_options)
51
- self.passed_count = 0
52
- self.pending_count = 0
53
- self.failed_count = 0
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
@@ -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.3.0
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
- MIIDrjCCApagAwIBAgIBATANBgkqhkiG9w0BAQUFADBOMRowGAYDVQQDDBFhY2Nv
16
- dW50c19ydWJ5Z2VtczEbMBkGCgmSJomT8ixkARkWC3RoZWtvbXBhbmVlMRMwEQYK
17
- CZImiZPyLGQBGRYDY29tMB4XDTE3MTIzMTIzMzUwNloXDTE4MTIzMTIzMzUwNlow
18
- TjEaMBgGA1UEAwwRYWNjb3VudHNfcnVieWdlbXMxGzAZBgoJkiaJk/IsZAEZFgt0
19
- aGVrb21wYW5lZTETMBEGCgmSJomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEB
20
- BQADggEPADCCAQoCggEBAO4TFnvU5R1rchKsNvNEiZUlOTuMtuE+OvMW4aOk3tIP
21
- JpczhDnRSLpbkpVvsuwfT9PgLjnAuan4oLB0eQVaOAgATFbmAfMsfU0gGtSWlczx
22
- 6vZjQqyGsW3P1abgGquLVubj409FMxfV18JUZlEmvCE1y9bM61gZ3oHTFPvBDoyX
23
- 3g9or9nenIa5jcJZd4C3ujW8yOxD+UskgAp+iZI2mIRtt2cJVg2/dnFAgqqp7Xy4
24
- c4OHZ6hqp2UcvhzuEdUJ6yRA8+Gn3jPOD+uXgUG84FfmU++NVoZyz+r0Nwa+De0H
25
- IObr8jftfL0PGdR8t1K61g12dZwGmpYTzmoJ1C+yS2ECAwEA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TIFICATE-----
36
- date: 2018-01-02 00:00:00.000000000 Z
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.0'
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: '1.7'
81
+ version: '3.7'
108
82
  description: the instafailing RSpec progress bar formatter
109
- email: '["jeff@kreeftmeijer.nl", "accounts+git@thekompanee.com"]'
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
- allowed_push_host: https://rubygems.org
125
- post_install_message:
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
- rubyforge_project:
141
- rubygems_version: 2.6.14
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
@@ -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