simplecov-lcov 0.8.0 → 0.9.0
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 +4 -4
- data/.coveralls.yml +8 -1
- data/lib/simple_cov_lcov/configuration.rb +1 -1
- data/lib/simplecov/lcov/version.rb +7 -0
- data/lib/simplecov-lcov.rb +6 -2
- data/simplecov-lcov.gemspec +16 -36
- data/spec/fixtures/lcov/spec-fixtures-app-models-user.rb.branch.lcov +2 -0
- data/spec/fixtures/lcov/spec-fixtures-app-models-user.rb.lcov +2 -0
- data/spec/fixtures/lcov/spec-fixtures-blank.rb.branch.lcov +6 -0
- data/spec/fixtures/lcov/spec-fixtures-blank.rb.lcov +4 -0
- data/spec/fixtures/lcov/spec-fixtures-hoge.rb.branch.lcov +2 -0
- data/spec/fixtures/lcov/spec-fixtures-hoge.rb.lcov +2 -0
- data/spec/simplecov-lcov_spec.rb +83 -23
- data/spec/spec_helper.rb +9 -9
- metadata +9 -8
- data/.travis.yml +0 -7
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b45d40f2e63cf73546dffac6367bca70c09688796964f90bc25cbfef0f8a5eb
|
4
|
+
data.tar.gz: feecf0f73ff209b3b2a0bdae343167b637de0ee3a0567101f72021824309b901
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d3c37479930114eba475e68b05a32b9991e531fd217cffc4ba85ec15d17839b9e43366c81c780cf6ec71252cbc64e6cdc30356ab8c441cac2976e7e7d0875ab
|
7
|
+
data.tar.gz: d5b74cf7218a792a1081cfe62187ccea6c7a4ea42649b67f052ae0ec25253f418ce93cd1ac2c8234b5ca03ebcced96e8b210d0d88bf992620303e7cba49f3eae
|
data/.coveralls.yml
CHANGED
data/lib/simplecov-lcov.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'pathname'
|
3
|
+
require_relative 'simplecov/lcov/version'
|
3
4
|
require_relative 'simple_cov_lcov/configuration'
|
4
5
|
|
5
6
|
fail 'simplecov-lcov requires simplecov' unless defined?(SimpleCov)
|
@@ -85,9 +86,12 @@ module SimpleCov
|
|
85
86
|
filename = file.filename.gsub("#{SimpleCov.root}/", './')
|
86
87
|
pieces = []
|
87
88
|
pieces << "SF:#{filename}"
|
88
|
-
|
89
|
+
lines = format_lines(file)
|
90
|
+
pieces << lines if lines.length > 0
|
91
|
+
pieces << "LF:#{file.lines.count(&:coverage)}"
|
92
|
+
pieces << "LH:#{file.lines.count(&:covered?)}"
|
89
93
|
|
90
|
-
if SimpleCov.branch_coverage?
|
94
|
+
if SimpleCov.respond_to?(:branch_coverage?) && SimpleCov.branch_coverage?
|
91
95
|
branch_data = format_branches(file)
|
92
96
|
pieces << branch_data if branch_data.length > 0
|
93
97
|
pieces << "BRF:#{file.total_branches.length}"
|
data/simplecov-lcov.gemspec
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/simplecov/lcov/version"
|
3
4
|
|
4
5
|
Gem::Specification.new do |s|
|
5
6
|
s.name = "simplecov-lcov".freeze
|
6
|
-
s.version =
|
7
|
+
s.version = SimpleCov::Lcov::VERSION
|
7
8
|
|
8
9
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
10
|
s.require_paths = ["lib".freeze]
|
10
11
|
s.authors = ["fortissimo1997".freeze]
|
11
|
-
s.date = "
|
12
|
+
s.date = Time.now.strftime("%Y-%m-%d")
|
12
13
|
s.description = "Custom SimpleCov formatter to generate a lcov style coverage.".freeze
|
13
14
|
s.email = "fortissimo1997@gmail.com".freeze
|
14
15
|
s.extra_rdoc_files = [
|
@@ -20,18 +21,19 @@ Gem::Specification.new do |s|
|
|
20
21
|
".document",
|
21
22
|
".rspec",
|
22
23
|
".tachikoma.yml",
|
23
|
-
".travis.yml",
|
24
24
|
"Gemfile",
|
25
25
|
"LICENSE.txt",
|
26
26
|
"README.markdown",
|
27
27
|
"Rakefile",
|
28
|
-
"
|
28
|
+
"lib/simplecov/lcov/version.rb",
|
29
29
|
"lib/simple_cov_lcov/configuration.rb",
|
30
30
|
"lib/simplecov-lcov.rb",
|
31
31
|
"simplecov-lcov.gemspec",
|
32
32
|
"spec/configuration_spec.rb",
|
33
33
|
"spec/fixtures/app/models/user.rb",
|
34
34
|
"spec/fixtures/hoge.rb",
|
35
|
+
"spec/fixtures/lcov/spec-fixtures-blank.rb.branch.lcov",
|
36
|
+
"spec/fixtures/lcov/spec-fixtures-blank.rb.lcov",
|
35
37
|
"spec/fixtures/lcov/spec-fixtures-app-models-user.rb.branch.lcov",
|
36
38
|
"spec/fixtures/lcov/spec-fixtures-app-models-user.rb.lcov",
|
37
39
|
"spec/fixtures/lcov/spec-fixtures-hoge.rb.branch.lcov",
|
@@ -41,37 +43,15 @@ Gem::Specification.new do |s|
|
|
41
43
|
]
|
42
44
|
s.homepage = "http://github.com/fortissimo1997/simplecov-lcov".freeze
|
43
45
|
s.licenses = ["MIT".freeze]
|
44
|
-
s.rubygems_version = "3.
|
46
|
+
s.rubygems_version = "3.7.1".freeze
|
45
47
|
s.summary = "Custom SimpleCov formatter to generate a lcov style coverage.".freeze
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
s.add_development_dependency(%q<rake>.freeze, [">= 0"])
|
55
|
-
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.18"])
|
56
|
-
s.add_development_dependency(%q<coveralls>.freeze, [">= 0"])
|
57
|
-
s.add_development_dependency(%q<activesupport>.freeze, [">= 0"])
|
58
|
-
else
|
59
|
-
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
60
|
-
s.add_dependency(%q<rdoc>.freeze, [">= 0"])
|
61
|
-
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
62
|
-
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
63
|
-
s.add_dependency(%q<simplecov>.freeze, ["~> 0.18"])
|
64
|
-
s.add_dependency(%q<coveralls>.freeze, [">= 0"])
|
65
|
-
s.add_dependency(%q<activesupport>.freeze, [">= 0"])
|
66
|
-
end
|
67
|
-
else
|
68
|
-
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
69
|
-
s.add_dependency(%q<rdoc>.freeze, [">= 0"])
|
70
|
-
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
71
|
-
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
72
|
-
s.add_dependency(%q<simplecov>.freeze, ["~> 0.18"])
|
73
|
-
s.add_dependency(%q<coveralls>.freeze, [">= 0"])
|
74
|
-
s.add_dependency(%q<activesupport>.freeze, [">= 0"])
|
75
|
-
end
|
49
|
+
s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<rdoc>.freeze, [">= 0"])
|
51
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
52
|
+
s.add_development_dependency(%q<rake>.freeze, [">= 0"])
|
53
|
+
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.18"])
|
54
|
+
s.add_development_dependency(%q<coveralls>.freeze, [">= 0"])
|
55
|
+
s.add_development_dependency(%q<activesupport>.freeze, [">= 0"])
|
76
56
|
end
|
77
57
|
|
data/spec/simplecov-lcov_spec.rb
CHANGED
@@ -13,6 +13,7 @@ module SimpleCov::Formatter
|
|
13
13
|
|
14
14
|
load 'fixtures/app/models/user.rb'
|
15
15
|
load 'fixtures/hoge.rb'
|
16
|
+
load 'fixtures/blank.rb'
|
16
17
|
end
|
17
18
|
|
18
19
|
describe '#format' do
|
@@ -48,29 +49,84 @@ module SimpleCov::Formatter
|
|
48
49
|
it { expect(File.read(output_path)).to eq(fixture) }
|
49
50
|
end
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
52
|
+
describe 'spec-fixtures-blank.rb.lcov' do
|
53
|
+
let(:output_path) {
|
54
|
+
File.join(LcovFormatter.config.output_directory, 'spec-fixtures-blank.rb.lcov')
|
55
|
+
}
|
56
|
+
let(:fixture) {
|
57
|
+
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-blank.rb.lcov")
|
58
|
+
}
|
59
|
+
it { expect(File.read(output_path)).to eq(fixture) }
|
60
|
+
end
|
61
|
+
|
62
|
+
describe 'branch coverage enabled' do
|
63
|
+
let(:branch_coverage_enabled) { true }
|
64
|
+
|
65
|
+
describe 'spec-fixtures-hoge.rb.branch.lcov' do
|
66
|
+
let(:output_path) {
|
67
|
+
File.join(LcovFormatter.config.output_directory, 'spec-fixtures-hoge.rb.lcov')
|
68
|
+
}
|
69
|
+
let(:fixture) {
|
70
|
+
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-hoge.rb.branch.lcov")
|
71
|
+
}
|
72
|
+
it { expect(File.read(output_path)).to eq(fixture) }
|
73
|
+
end
|
74
|
+
|
75
|
+
describe 'spec-fixtures-app-models-user.rb.branch.lcov' do
|
76
|
+
let(:output_path) {
|
77
|
+
File.join(LcovFormatter.config.output_directory, 'spec-fixtures-app-models-user.rb.lcov')
|
78
|
+
}
|
79
|
+
let(:fixture) {
|
80
|
+
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-app-models-user.rb.branch.lcov")
|
81
|
+
}
|
82
|
+
it { expect(File.read(output_path)).to eq(fixture) }
|
83
|
+
end
|
84
|
+
|
85
|
+
describe 'spec-fixtures-blank.rb.branch.lcov' do
|
86
|
+
let(:output_path) {
|
87
|
+
File.join(LcovFormatter.config.output_directory, 'spec-fixtures-blank.rb.lcov')
|
88
|
+
}
|
89
|
+
let(:fixture) {
|
90
|
+
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-blank.rb.branch.lcov")
|
91
|
+
}
|
92
|
+
it { expect(File.read(output_path)).to eq(fixture) }
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
context 'SimpleCov.branch_coverage? is missing' do
|
97
|
+
before do
|
98
|
+
allow(SimpleCov).to receive(:branch_coverage?).and_return(false)
|
99
|
+
LcovFormatter.new.format(simplecov_result)
|
100
|
+
end
|
101
|
+
|
102
|
+
describe 'spec-fixtures-hoge.rb.lcov' do
|
103
|
+
let(:output_path) {
|
104
|
+
File.join(LcovFormatter.config.output_directory, 'spec-fixtures-hoge.rb.lcov')
|
105
|
+
}
|
106
|
+
let(:fixture) {
|
107
|
+
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-hoge.rb.lcov")
|
108
|
+
}
|
109
|
+
it { expect(File.read(output_path)).to eq(fixture) }
|
110
|
+
end
|
111
|
+
|
112
|
+
describe 'spec-fixtures-app-models-user.rb.lcov' do
|
113
|
+
let(:output_path) {
|
114
|
+
File.join(LcovFormatter.config.output_directory, 'spec-fixtures-app-models-user.rb.lcov')
|
115
|
+
}
|
116
|
+
let(:fixture) {
|
117
|
+
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-app-models-user.rb.lcov")
|
118
|
+
}
|
119
|
+
it { expect(File.read(output_path)).to eq(fixture) }
|
120
|
+
end
|
121
|
+
|
122
|
+
describe 'spec-fixtures-blank.rb.lcov' do
|
123
|
+
let(:output_path) {
|
124
|
+
File.join(LcovFormatter.config.output_directory, 'spec-fixtures-blank.rb.lcov')
|
125
|
+
}
|
126
|
+
let(:fixture) {
|
127
|
+
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-blank.rb.lcov")
|
128
|
+
}
|
129
|
+
it { expect(File.read(output_path)).to eq(fixture) }
|
74
130
|
end
|
75
131
|
end
|
76
132
|
end
|
@@ -95,8 +151,12 @@ module SimpleCov::Formatter
|
|
95
151
|
let(:fixture_of_user) {
|
96
152
|
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-app-models-user.rb.lcov")
|
97
153
|
}
|
154
|
+
let(:fixture_of_blank) {
|
155
|
+
File.read("#{File.dirname(__FILE__)}/fixtures/lcov/spec-fixtures-blank.rb.lcov")
|
156
|
+
}
|
98
157
|
it { expect(File.read(output_path)).to match(fixture_of_hoge) }
|
99
158
|
it { expect(File.read(output_path)).to match(fixture_of_user) }
|
159
|
+
it { expect(File.read(output_path)).to match(fixture_of_blank) }
|
100
160
|
end
|
101
161
|
end
|
102
162
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -29,13 +29,13 @@ require 'simplecov-lcov'
|
|
29
29
|
# Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
30
30
|
|
31
31
|
RSpec.configure do |config|
|
32
|
-
config.before(:each) do
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
32
|
+
# config.before(:each) do
|
33
|
+
# if Dir.exist?(SimpleCov::Formatter::LcovFormatter.config.output_directory)
|
34
|
+
# FileUtils
|
35
|
+
# .remove_dir(
|
36
|
+
# SimpleCov::Formatter::LcovFormatter.config.output_directory,
|
37
|
+
# true
|
38
|
+
# )
|
39
|
+
# end
|
40
|
+
# end
|
41
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov-lcov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fortissimo1997
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -120,20 +120,21 @@ files:
|
|
120
120
|
- ".document"
|
121
121
|
- ".rspec"
|
122
122
|
- ".tachikoma.yml"
|
123
|
-
- ".travis.yml"
|
124
123
|
- Gemfile
|
125
124
|
- LICENSE.txt
|
126
125
|
- README.markdown
|
127
126
|
- Rakefile
|
128
|
-
- VERSION
|
129
127
|
- lib/simple_cov_lcov/configuration.rb
|
130
128
|
- lib/simplecov-lcov.rb
|
129
|
+
- lib/simplecov/lcov/version.rb
|
131
130
|
- simplecov-lcov.gemspec
|
132
131
|
- spec/configuration_spec.rb
|
133
132
|
- spec/fixtures/app/models/user.rb
|
134
133
|
- spec/fixtures/hoge.rb
|
135
134
|
- spec/fixtures/lcov/spec-fixtures-app-models-user.rb.branch.lcov
|
136
135
|
- spec/fixtures/lcov/spec-fixtures-app-models-user.rb.lcov
|
136
|
+
- spec/fixtures/lcov/spec-fixtures-blank.rb.branch.lcov
|
137
|
+
- spec/fixtures/lcov/spec-fixtures-blank.rb.lcov
|
137
138
|
- spec/fixtures/lcov/spec-fixtures-hoge.rb.branch.lcov
|
138
139
|
- spec/fixtures/lcov/spec-fixtures-hoge.rb.lcov
|
139
140
|
- spec/simplecov-lcov_spec.rb
|
@@ -142,7 +143,7 @@ homepage: http://github.com/fortissimo1997/simplecov-lcov
|
|
142
143
|
licenses:
|
143
144
|
- MIT
|
144
145
|
metadata: {}
|
145
|
-
post_install_message:
|
146
|
+
post_install_message:
|
146
147
|
rdoc_options: []
|
147
148
|
require_paths:
|
148
149
|
- lib
|
@@ -157,8 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
158
|
- !ruby/object:Gem::Version
|
158
159
|
version: '0'
|
159
160
|
requirements: []
|
160
|
-
rubygems_version: 3.
|
161
|
-
signing_key:
|
161
|
+
rubygems_version: 3.5.22
|
162
|
+
signing_key:
|
162
163
|
specification_version: 4
|
163
164
|
summary: Custom SimpleCov formatter to generate a lcov style coverage.
|
164
165
|
test_files: []
|
data/.travis.yml
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.8.0
|