coveralls_reborn 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,7 +75,6 @@ describe Coveralls do
75
75
  end
76
76
  end
77
77
 
78
- expect(::SimpleCov).to have_received(:start).with 'rails'
79
78
  expect(::SimpleCov.formatter).to be Coveralls::NilFormatter
80
79
  end
81
80
  end
@@ -3,8 +3,8 @@ class Foo
3
3
  def initialize
4
4
  @foo = 'baz'
5
5
  end
6
-
6
+
7
7
  def bar
8
8
  @foo
9
9
  end
10
- end
10
+ end
@@ -3,8 +3,8 @@ class Foo
3
3
  def initialize
4
4
  @foo = 'baz'
5
5
  end
6
-
6
+
7
7
  def bar
8
8
  @foo
9
9
  end
10
- end
10
+ end
@@ -3,8 +3,8 @@ class Foo
3
3
  def initialize
4
4
  @foo = 'baz'
5
5
  end
6
-
6
+
7
7
  def bar
8
8
  @foo
9
9
  end
10
- end
10
+ end
@@ -3,8 +3,8 @@ class Foo
3
3
  def initialize
4
4
  @foo = 'baz'
5
5
  end
6
-
6
+
7
7
  def bar
8
8
  @foo
9
9
  end
10
- end
10
+ end
@@ -1 +1 @@
1
- # this file should not be covered
1
+ # this file should not be covered
@@ -11,6 +11,7 @@ describe Coveralls::Output do
11
11
  out = StringIO.new
12
12
  allow(described_class).to receive(:output).and_return(out)
13
13
  described_class.puts 'this is a test'
14
+
14
15
  expect(out.string).to eq "this is a test\n"
15
16
  end
16
17
 
@@ -18,6 +19,7 @@ describe Coveralls::Output do
18
19
  it 'accepts an IO injection' do
19
20
  out = StringIO.new
20
21
  described_class.puts 'this is a test', output: out
22
+
21
23
  expect(out.string).to eq "this is a test\n"
22
24
  end
23
25
  end
@@ -26,6 +28,7 @@ describe Coveralls::Output do
26
28
  it 'accepts an IO injection' do
27
29
  out = StringIO.new
28
30
  described_class.print 'this is a test', output: out
31
+
29
32
  expect(out.string).to eq 'this is a test'
30
33
  end
31
34
  end
@@ -33,7 +36,7 @@ describe Coveralls::Output do
33
36
  describe 'when silenced' do
34
37
  before { described_class.silent = true }
35
38
 
36
- it 'does not puts' do
39
+ it 'does not put' do
37
40
  expect { described_class.puts 'foo' }.not_to output("foo\n").to_stdout
38
41
  end
39
42
 
@@ -50,7 +53,7 @@ describe Coveralls::Output do
50
53
  expect(described_class.format(string, color: 'red')).to eq(ansi_color_string)
51
54
  end
52
55
 
53
- it 'also accepts no color arguments' do
56
+ it 'accepts no color arguments' do
54
57
  unformatted_string = 'Hi Doggie!'
55
58
  expect(described_class.format(unformatted_string)).to eq(unformatted_string)
56
59
  end
@@ -71,8 +74,7 @@ describe Coveralls::Output do
71
74
 
72
75
  it 'does not add color to string' do
73
76
  unformatted_string = 'Hi Doggie!'
74
- expect(described_class.format(unformatted_string, color: 'red'))
75
- .to eq(unformatted_string)
77
+ expect(described_class.format(unformatted_string, color: 'red')).to eq(unformatted_string)
76
78
  end
77
79
  end
78
80
  end
@@ -78,5 +78,27 @@ describe Coveralls::SimpleCov::Formatter do
78
78
  expect(source_file[:coverage]).to eq [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil, nil, nil, nil]
79
79
  end
80
80
  end
81
+
82
+ describe '#short_filename' do
83
+ subject { described_class.new.short_filename(filename) }
84
+
85
+ let(:filename) { '/app/app/controllers/application_controller.rb' }
86
+
87
+ before do
88
+ allow(SimpleCov).to receive(:root).and_return(root_path)
89
+ end
90
+
91
+ context 'with nil root path' do
92
+ let(:root_path) { nil }
93
+
94
+ it { is_expected.to eql filename }
95
+ end
96
+
97
+ context 'with multiple matches of root path' do
98
+ let(:root_path) { '/app' }
99
+
100
+ it { is_expected.to eql 'app/controllers/application_controller.rb' }
101
+ end
102
+ end
81
103
  end
82
104
  end
@@ -19,11 +19,11 @@ def setup_formatter
19
19
  SimpleCov::Formatter::HTMLFormatter
20
20
  end
21
21
 
22
- # SimpleCov.start 'test_frameworks'
23
22
  SimpleCov.start do
24
23
  add_filter do |source_file|
25
24
  source_file.filename =~ /spec/ && source_file.filename !~ /fixture/
26
25
  end
26
+ add_filter %r{/.bundle/}
27
27
  end
28
28
  end
29
29
 
@@ -40,6 +40,7 @@ RSpec.configure do |config|
40
40
  config.run_all_when_everything_filtered = true
41
41
  config.filter_run :focus
42
42
  config.include WebMock::API
43
+
43
44
  config.after(:suite) do
44
45
  setup_formatter
45
46
  WebMock.disable!
@@ -50,11 +51,11 @@ def stub_api_post
50
51
  body = '{"message":"","url":""}'
51
52
  stub_request(:post, Coveralls::API::API_BASE + '/jobs').with(
52
53
  headers: {
53
- 'Accept' => '*/*; q=0.5, application/xml',
54
+ 'Accept' => '*/*; q=0.5, application/xml',
54
55
  'Accept-Encoding' => 'gzip, deflate',
55
- 'Content-Length' => /.+/,
56
- 'Content-Type' => /.+/,
57
- 'User-Agent' => 'Ruby'
56
+ 'Content-Length' => /.+/,
57
+ 'Content-Type' => /.+/,
58
+ 'User-Agent' => 'Ruby'
58
59
  }
59
60
  ).to_return(status: 200, body: body, headers: {})
60
61
  end
@@ -67,13 +68,12 @@ def silence
67
68
  end
68
69
  end
69
70
 
70
- module Kernel
71
- def silence_stream(stream)
72
- old_stream = stream.dup
73
- stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null')
74
- stream.sync = true
75
- yield
76
- ensure
77
- stream.reopen(old_stream)
78
- end
71
+ def silence_stream(stream)
72
+ old_stream = stream.dup
73
+ stream.reopen(IO::NULL)
74
+ stream.sync = true
75
+ yield
76
+ ensure
77
+ stream.reopen(old_stream)
78
+ old_stream.close
79
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveralls_reborn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Merwin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-07-27 00:00:00.000000000 Z
13
+ date: 2019-07-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 0.16.1
35
+ version: 0.17.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 0.16.1
42
+ version: 0.17.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: term-ansicolor
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -86,16 +86,22 @@ dependencies:
86
86
  name: bundler
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - "~>"
89
+ - - ">="
90
90
  - !ruby/object:Gem::Version
91
91
  version: '1.16'
92
+ - - "<"
93
+ - !ruby/object:Gem::Version
94
+ version: '3'
92
95
  type: :development
93
96
  prerelease: false
94
97
  version_requirements: !ruby/object:Gem::Requirement
95
98
  requirements:
96
- - - "~>"
99
+ - - ">="
97
100
  - !ruby/object:Gem::Version
98
101
  version: '1.16'
102
+ - - "<"
103
+ - !ruby/object:Gem::Version
104
+ version: '3'
99
105
  description: A Ruby implementation of the Coveralls API.
100
106
  email:
101
107
  - nick@lemurheavy.com
@@ -142,7 +148,8 @@ files:
142
148
  homepage: https://coveralls.io
143
149
  licenses:
144
150
  - MIT
145
- metadata: {}
151
+ metadata:
152
+ source_code_uri: https://github.com/tagliala/coveralls-ruby-reborn
146
153
  post_install_message:
147
154
  rdoc_options: []
148
155
  require_paths:
@@ -151,15 +158,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
158
  requirements:
152
159
  - - ">="
153
160
  - !ruby/object:Gem::Version
154
- version: '2.2'
161
+ version: '2.3'
155
162
  required_rubygems_version: !ruby/object:Gem::Requirement
156
163
  requirements:
157
164
  - - ">="
158
165
  - !ruby/object:Gem::Version
159
166
  version: '0'
160
167
  requirements: []
161
- rubyforge_project:
162
- rubygems_version: 2.7.7
168
+ rubygems_version: 3.0.4
163
169
  signing_key:
164
170
  specification_version: 4
165
171
  summary: A Ruby implementation of the Coveralls API.