simplecov-reports 0.0.4.ooyala
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +18 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +66 -0
- data/Rakefile +73 -0
- data/lib/simplecov-html-extended.rb +50 -0
- data/lib/simplecov/configuration.rb +98 -0
- data/lib/simplecov/reports.rb +5 -0
- data/lib/simplecov/reports/author_report.rb +180 -0
- data/lib/simplecov/reports/file_report.rb +97 -0
- data/lib/simplecov/reports/version.rb +5 -0
- data/lib/simplecov/source_file.rb +39 -0
- data/simplecov-reports.gemspec +29 -0
- data/test/fixtures/author_report/author_stats_file1.rb +23 -0
- data/test/fixtures/author_report/author_stats_file2.rb +26 -0
- data/test/fixtures/author_report/best_author_tolerance.rb +264 -0
- data/test/fixtures/file_report/classes_covered.rb +80 -0
- data/test/fixtures/file_report/classes_not_covered.rb +37 -0
- data/test/fixtures/file_report/classes_partially_covered.rb +11 -0
- data/test/fixtures/file_report/methods_covered.rb +38 -0
- data/test/fixtures/file_report/methods_not_covered.rb +39 -0
- data/test/fixtures/file_report/methods_partially_covered.rb +13 -0
- data/test/fixtures/line enhancer/line_enhancer_fixture.rb +1 -0
- data/test/helper.rb +19 -0
- data/test/memory_measure.rb +0 -0
- data/test/test_all_reports.rb +35 -0
- data/test/test_author_stats.rb +89 -0
- data/test/test_best_author_stage1.rb +75 -0
- data/test/test_best_author_stage2.rb +75 -0
- data/test/test_best_author_stage3.rb +86 -0
- data/test/test_best_author_stage4.rb +97 -0
- data/test/test_best_author_stage5.rb +97 -0
- data/test/test_file_reports.rb +159 -0
- data/test/test_html_reports.rb +43 -0
- data/test/test_line_enhancer.rb +26 -0
- data/views/author_report.erb +37 -0
- data/views/file_report.erb +21 -0
- metadata +203 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
require_relative 'helper'
|
2
|
+
|
3
|
+
SimpleCov.start do
|
4
|
+
use_merging true
|
5
|
+
merge_timeout 3600
|
6
|
+
|
7
|
+
add_report :type => SimpleCov::Configuration::ReportTypes::ItemsMissingCoverage::Api
|
8
|
+
add_report :type => SimpleCov::Configuration::ReportTypes::ItemsMissingCoverage::Class
|
9
|
+
add_report :type => SimpleCov::Configuration::ReportTypes::ItemsMissingCoverage::Method
|
10
|
+
add_report :type => SimpleCov::Configuration::ReportTypes::ItemsMissingCoverage::Configure
|
11
|
+
add_report(:type => SimpleCov::Configuration::ReportTypes::Author,
|
12
|
+
:sub_types => [
|
13
|
+
SimpleCov::Configuration::ReportTypes::Author::BestAuthor,
|
14
|
+
SimpleCov::Configuration::ReportTypes::Author::AuthorStats
|
15
|
+
],
|
16
|
+
:best_authors_count => 3)
|
17
|
+
end
|
18
|
+
|
19
|
+
class TestHtmlReports < Test::Unit::TestCase
|
20
|
+
context "html coverage file" do
|
21
|
+
setup do
|
22
|
+
@result = SimpleCov.result.format!
|
23
|
+
end
|
24
|
+
|
25
|
+
should "have all the reports" do
|
26
|
+
file = IO.read("tmp/coverage/index.html")
|
27
|
+
|
28
|
+
classes_report_present = file =~ /<span class=\"group_name\" style=\"color:#9a3221\">Classes missing coverage<\/span>/
|
29
|
+
methods_report_present = file =~ /<span class=\"group_name\" style=\"color:#9a3221\">Methods missing coverage<\/span>/
|
30
|
+
api_report_present = file =~ /<span class=\"group_name\" style=\"color:#9a3221\">API methods missing coverage<\/span>/
|
31
|
+
configure_report_present = file =~ /<span class=\"group_name\" style=\"color:#9a3221\">Configure methods missing coverage<\/span>/
|
32
|
+
best_author_report_present = file =~ /<span class=\"group_name\" style=\"color:#9a3221\">Best Authors<\/span>/
|
33
|
+
author_stats_report_present = file =~ /<span class=\"group_name\" style=\"color:#9a3221\">Author Stats<\/span>/
|
34
|
+
|
35
|
+
assert classes_report_present, "Classes report absent"
|
36
|
+
assert methods_report_present, "Methods report absent"
|
37
|
+
assert api_report_present, "API methods report absent"
|
38
|
+
assert configure_report_present, "Configure report absent"
|
39
|
+
assert best_author_report_present, "Best Author report absent"
|
40
|
+
assert author_stats_report_present, "Author Stats report absent"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative 'helper'
|
2
|
+
|
3
|
+
SimpleCov.start do
|
4
|
+
use_merging true
|
5
|
+
merge_timeout 3600
|
6
|
+
end
|
7
|
+
|
8
|
+
# Execute code to get coverage
|
9
|
+
COVERAGE = "cover"
|
10
|
+
require_relative "fixtures/line enhancer/line_enhancer_fixture"
|
11
|
+
|
12
|
+
|
13
|
+
class TestLineEnhancer < Test::Unit::TestCase
|
14
|
+
context "line enhancers" do
|
15
|
+
setup do
|
16
|
+
@result = SimpleCov.result.format!
|
17
|
+
end
|
18
|
+
|
19
|
+
should "have enhanced line attributes" do
|
20
|
+
author = @result.files[0].lines[0].author
|
21
|
+
date = @result.files[0].lines[0].date
|
22
|
+
assert_equal ["Rajesh Konda", "2013-06-28 20:53:45 -0700"], [author, date.to_s],
|
23
|
+
"author and date attributes of the line should match"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end # class TestAuthorReports
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<div class="report_container" id="<%= title_id %>">
|
2
|
+
<h2>
|
3
|
+
<span class="group_name" style="color:#9a3221"><%= sub_report[:title] %></span>
|
4
|
+
</h2>
|
5
|
+
<% sub_report[:items].each do |author_name, author_stats| %>
|
6
|
+
<h3 style="color:#167048"><%= author_name %></h3>
|
7
|
+
<table class="report_content">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th> file name</th>
|
11
|
+
<th style="text-align:right">covered</th>
|
12
|
+
<th style="text-align:right">missed</th>
|
13
|
+
<th style="text-align:right">total</th>
|
14
|
+
<th style="text-align:right">coverage</th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
|
+
<% author_stats[:files].each do |file, file_stats| %>
|
19
|
+
<tr>
|
20
|
+
<td><%= link_to_source_file(file) %></td>
|
21
|
+
<td style="text-align:right"><%= file_stats[:covered] %></td>
|
22
|
+
<td style="text-align:right"><%= file_stats[:missed] %></td>
|
23
|
+
<td style="text-align:right"><%= file_stats[:total] %></td>
|
24
|
+
<td style="text-align:right"><%= (file_stats[:coverage] + 0.5).floor %></td>
|
25
|
+
</tr>
|
26
|
+
<% end %>
|
27
|
+
<tr>
|
28
|
+
<td><h4 style="color:#2f1408"><%= "Coverage Summary" %></h4></td>
|
29
|
+
<td style="text-align:right"><%= author_stats[:total_coverage][:covered] %></td>
|
30
|
+
<td style="text-align:right"><%= author_stats[:total_coverage][:missed] %></td>
|
31
|
+
<td style="text-align:right"><%= author_stats[:total_coverage][:total] %></td>
|
32
|
+
<td style="text-align:right"><%= (author_stats[:total_coverage][:coverage] + 0.5).floor %></td>
|
33
|
+
</tr>
|
34
|
+
</tbody>
|
35
|
+
</table>
|
36
|
+
<% end %>
|
37
|
+
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div class="report_container" id="<%= title_id %>">
|
2
|
+
<h2>
|
3
|
+
<span class="group_name" style="color:#9a3221"><%= report[:title] %></span>
|
4
|
+
</h2>
|
5
|
+
<% report[:items].each do |source_file, lines| %>
|
6
|
+
<table class="report_content">
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th><%= link_to_source_file(source_file) %></th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<% lines.each do |line| %>
|
14
|
+
<tr>
|
15
|
+
<td><%= line.source %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</tbody>
|
19
|
+
</table>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
metadata
ADDED
@@ -0,0 +1,203 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simplecov-reports
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4.ooyala
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rajesh Konda
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry-nav
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: shoulda
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: ooyala-grit
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.9.3.ooyala
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.9.3.ooyala
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov-html
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.7.6.ooyala
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.7.6.ooyala
|
111
|
+
description: Contains code that enhances simplecov, and simplecov-html gems with FileReport
|
112
|
+
and AuthorReport
|
113
|
+
email:
|
114
|
+
- rkonda@ooyala.com
|
115
|
+
executables: []
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- .gitignore
|
120
|
+
- Gemfile
|
121
|
+
- LICENSE.txt
|
122
|
+
- README.md
|
123
|
+
- Rakefile
|
124
|
+
- lib/simplecov-html-extended.rb
|
125
|
+
- lib/simplecov/configuration.rb
|
126
|
+
- lib/simplecov/reports.rb
|
127
|
+
- lib/simplecov/reports/author_report.rb
|
128
|
+
- lib/simplecov/reports/file_report.rb
|
129
|
+
- lib/simplecov/reports/version.rb
|
130
|
+
- lib/simplecov/source_file.rb
|
131
|
+
- simplecov-reports.gemspec
|
132
|
+
- test/fixtures/author_report/author_stats_file1.rb
|
133
|
+
- test/fixtures/author_report/author_stats_file2.rb
|
134
|
+
- test/fixtures/author_report/best_author_tolerance.rb
|
135
|
+
- test/fixtures/file_report/classes_covered.rb
|
136
|
+
- test/fixtures/file_report/classes_not_covered.rb
|
137
|
+
- test/fixtures/file_report/classes_partially_covered.rb
|
138
|
+
- test/fixtures/file_report/methods_covered.rb
|
139
|
+
- test/fixtures/file_report/methods_not_covered.rb
|
140
|
+
- test/fixtures/file_report/methods_partially_covered.rb
|
141
|
+
- test/fixtures/line enhancer/line_enhancer_fixture.rb
|
142
|
+
- test/helper.rb
|
143
|
+
- test/memory_measure.rb
|
144
|
+
- test/test_all_reports.rb
|
145
|
+
- test/test_author_stats.rb
|
146
|
+
- test/test_best_author_stage1.rb
|
147
|
+
- test/test_best_author_stage2.rb
|
148
|
+
- test/test_best_author_stage3.rb
|
149
|
+
- test/test_best_author_stage4.rb
|
150
|
+
- test/test_best_author_stage5.rb
|
151
|
+
- test/test_file_reports.rb
|
152
|
+
- test/test_html_reports.rb
|
153
|
+
- test/test_line_enhancer.rb
|
154
|
+
- views/author_report.erb
|
155
|
+
- views/file_report.erb
|
156
|
+
homepage: ''
|
157
|
+
licenses:
|
158
|
+
- MIT
|
159
|
+
metadata: {}
|
160
|
+
post_install_message:
|
161
|
+
rdoc_options: []
|
162
|
+
require_paths:
|
163
|
+
- lib
|
164
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ! '>='
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ! '>'
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 1.3.1
|
174
|
+
requirements: []
|
175
|
+
rubyforge_project:
|
176
|
+
rubygems_version: 2.0.5
|
177
|
+
signing_key:
|
178
|
+
specification_version: 4
|
179
|
+
summary: ! 'Reports added to simplecov and simplecov-html: FileReport and AuthorReport'
|
180
|
+
test_files:
|
181
|
+
- test/fixtures/author_report/author_stats_file1.rb
|
182
|
+
- test/fixtures/author_report/author_stats_file2.rb
|
183
|
+
- test/fixtures/author_report/best_author_tolerance.rb
|
184
|
+
- test/fixtures/file_report/classes_covered.rb
|
185
|
+
- test/fixtures/file_report/classes_not_covered.rb
|
186
|
+
- test/fixtures/file_report/classes_partially_covered.rb
|
187
|
+
- test/fixtures/file_report/methods_covered.rb
|
188
|
+
- test/fixtures/file_report/methods_not_covered.rb
|
189
|
+
- test/fixtures/file_report/methods_partially_covered.rb
|
190
|
+
- test/fixtures/line enhancer/line_enhancer_fixture.rb
|
191
|
+
- test/helper.rb
|
192
|
+
- test/memory_measure.rb
|
193
|
+
- test/test_all_reports.rb
|
194
|
+
- test/test_author_stats.rb
|
195
|
+
- test/test_best_author_stage1.rb
|
196
|
+
- test/test_best_author_stage2.rb
|
197
|
+
- test/test_best_author_stage3.rb
|
198
|
+
- test/test_best_author_stage4.rb
|
199
|
+
- test/test_best_author_stage5.rb
|
200
|
+
- test/test_file_reports.rb
|
201
|
+
- test/test_html_reports.rb
|
202
|
+
- test/test_line_enhancer.rb
|
203
|
+
has_rdoc:
|