rspec-progress-bar 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1d18a6548bea579d256e260cef1e5c4c88d2d6e7b52fc61508e812031a90dd9
4
- data.tar.gz: 13c3bdb592dbe28be91cc0951e30658f60d866208600543a1e88af10e9a851ed
3
+ metadata.gz: c1bf926c21b6ac214c4aab42c218c61f756d9a970abfd11fefd534325e918032
4
+ data.tar.gz: 198449e5bd7afa7935d55d0b590f9fdeb1b897d0c7b5643973888e95a0fce466
5
5
  SHA512:
6
- metadata.gz: ee96050000b4c60952b9313921693cfcddea4250d3a8b62d470a577d046ce4f06a918a9bf39452b85a5c620919ebee510c24e48dabf9fb15132ceb2ac5e7c3d4
7
- data.tar.gz: 0fcf2495897d5ef0a0c7bdb237f4707f1b9940b89aa57a3ec1e42b2e5fbf288241414ac4f979c84d876f7d827dec82b13a2be36a4b28f5616dfc59ffc3e22f51
6
+ metadata.gz: 70c8d5ac52a9f35934f27d93b6046c860556f2da1e6887cf7280b374ac85cfae8a0698b908bde2f0dcf1c769d52c7802a0e43168e625fb372a374ceb3e23342c
7
+ data.tar.gz: 474c88df469c43163d3023fa70d32349b979cfb6361a26f778f4bc7b25ab7e84bf36e1fb9086ce8cf0133a0e5107419f0d46590d0a88ed485fb8370aa9783632
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  /Gemfile.lock
2
+ *.gem
@@ -8,17 +8,14 @@ module RspecProgressBar
8
8
 
9
9
  attr_accessor :progress_bar
10
10
 
11
- def initialize(output)
12
- @output = output
13
- end
14
-
15
11
  def start(notification)
16
12
  @progress_bar = ProgressBar.new(notification.count)
17
13
  end
18
14
 
19
15
  def example_started(_notification)
20
16
  progress_bar.count += 1
21
- @output << "#{progress_bar}\r"
17
+ output << "#{progress_bar}\r"
18
+ output.flush
22
19
  end
23
20
  end
24
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RspecProgressBar
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -6,6 +6,10 @@ RSpec.describe RspecProgressBar::Formatter do
6
6
  let(:io) { double }
7
7
  let(:formatter) { described_class.new(io) }
8
8
 
9
+ it 'inherits from RSpec::Core::Formatters::BaseTextFormatter' do
10
+ expect(formatter).to be_a(RSpec::Core::Formatters::BaseTextFormatter)
11
+ end
12
+
9
13
  describe '#initialize' do
10
14
  it 'assigns @output' do
11
15
  expect(formatter.instance_variable_get(:@output)).to eq(io)
@@ -32,6 +36,7 @@ RSpec.describe RspecProgressBar::Formatter do
32
36
  before do
33
37
  formatter.start(notification)
34
38
  allow(io).to receive(:<<)
39
+ allow(io).to receive(:flush)
35
40
  allow(formatter.progress_bar)
36
41
  .to receive(:to_s)
37
42
  .and_return('PROGRESS')
@@ -51,5 +56,11 @@ RSpec.describe RspecProgressBar::Formatter do
51
56
  .to have_received(:<<)
52
57
  .with("PROGRESS\r")
53
58
  end
59
+
60
+ it 'flushes IO to OS' do
61
+ formatter.example_started(notification)
62
+
63
+ expect(io).to have_received(:flush)
64
+ end
54
65
  end
55
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-progress-bar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Trushkevich