simplecov 0.15.0 → 0.16.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 +5 -5
- data/CHANGELOG.md +26 -2
- data/CONTRIBUTING.md +12 -9
- data/ISSUE_TEMPLATE.md +23 -0
- data/README.md +42 -16
- data/doc/alternate-formatters.md +16 -1
- data/lib/simplecov/command_guesser.rb +2 -0
- data/lib/simplecov/configuration.rb +2 -0
- data/lib/simplecov/defaults.rb +9 -80
- data/lib/simplecov/exit_codes.rb +2 -0
- data/lib/simplecov/file_list.rb +2 -0
- data/lib/simplecov/filter.rb +3 -1
- data/lib/simplecov/formatter/multi_formatter.rb +2 -0
- data/lib/simplecov/formatter/simple_formatter.rb +2 -0
- data/lib/simplecov/formatter.rb +2 -0
- data/lib/simplecov/jruby_fix.rb +2 -0
- data/lib/simplecov/last_run.rb +2 -0
- data/lib/simplecov/lines_classifier.rb +19 -3
- data/lib/simplecov/load_global_config.rb +2 -0
- data/lib/simplecov/no_defaults.rb +2 -0
- data/lib/simplecov/profiles/bundler_filter.rb +5 -0
- data/lib/simplecov/profiles/rails.rb +18 -0
- data/lib/simplecov/profiles/root_filter.rb +10 -0
- data/lib/simplecov/profiles/test_frameworks.rb +8 -0
- data/lib/simplecov/profiles.rb +2 -0
- data/lib/simplecov/railtie.rb +2 -0
- data/lib/simplecov/railties/tasks.rake +2 -0
- data/lib/simplecov/raw_coverage.rb +2 -0
- data/lib/simplecov/result.rb +2 -0
- data/lib/simplecov/result_merger.rb +2 -0
- data/lib/simplecov/source_file.rb +3 -1
- data/lib/simplecov/version.rb +3 -1
- data/lib/simplecov.rb +91 -0
- metadata +22 -117
- data/.gitignore +0 -31
- data/.rspec +0 -3
- data/.rubocop.yml +0 -88
- data/.travis.yml +0 -29
- data/.yardopts +0 -1
- data/Gemfile +0 -38
- data/MIT-LICENSE +0 -20
- data/Rakefile +0 -41
- data/cucumber.yml +0 -13
- data/features/config_autoload.feature +0 -46
- data/features/config_command_name.feature +0 -45
- data/features/config_coverage_dir.feature +0 -33
- data/features/config_deactivate_merging.feature +0 -42
- data/features/config_formatters.feature +0 -77
- data/features/config_merge_timeout.feature +0 -39
- data/features/config_nocov_token.feature +0 -79
- data/features/config_profiles.feature +0 -44
- data/features/config_project_name.feature +0 -27
- data/features/config_styles.feature +0 -121
- data/features/config_tracked_files.feature +0 -29
- data/features/config_tracked_files_relevant_lines.feature +0 -31
- data/features/cucumber_basic.feature +0 -29
- data/features/maximum_coverage_drop.feature +0 -89
- data/features/merging_test_unit_and_rspec.feature +0 -44
- data/features/minimum_coverage.feature +0 -59
- data/features/refuse_coverage_drop.feature +0 -95
- data/features/rspec_basic.feature +0 -32
- data/features/rspec_fails_on_initialization.feature +0 -14
- data/features/rspec_groups_and_filters_basic.feature +0 -29
- data/features/rspec_groups_and_filters_complex.feature +0 -37
- data/features/rspec_groups_using_filter_class.feature +0 -41
- data/features/rspec_without_simplecov.feature +0 -20
- data/features/skipping_code_blocks_manually.feature +0 -70
- data/features/step_definitions/html_steps.rb +0 -44
- data/features/step_definitions/simplecov_steps.rb +0 -68
- data/features/step_definitions/transformers.rb +0 -13
- data/features/step_definitions/web_steps.rb +0 -64
- data/features/support/aruba_freedom_patch.rb +0 -53
- data/features/support/env.rb +0 -50
- data/features/test_unit_basic.feature +0 -34
- data/features/test_unit_groups_and_filters_basic.feature +0 -29
- data/features/test_unit_groups_and_filters_complex.feature +0 -35
- data/features/test_unit_groups_using_filter_class.feature +0 -40
- data/features/test_unit_without_simplecov.feature +0 -20
- data/features/unicode_compatiblity.feature +0 -67
- data/simplecov.gemspec +0 -27
- data/spec/1_8_fallbacks_spec.rb +0 -31
- data/spec/command_guesser_spec.rb +0 -48
- data/spec/config_loader_spec.rb +0 -14
- data/spec/configuration_spec.rb +0 -35
- data/spec/deleted_source_spec.rb +0 -12
- data/spec/faked_project/Gemfile +0 -6
- data/spec/faked_project/Rakefile +0 -8
- data/spec/faked_project/cucumber.yml +0 -13
- data/spec/faked_project/features/step_definitions/my_steps.rb +0 -22
- data/spec/faked_project/features/support/env.rb +0 -12
- data/spec/faked_project/features/test_stuff.feature +0 -6
- data/spec/faked_project/lib/faked_project/framework_specific.rb +0 -18
- data/spec/faked_project/lib/faked_project/meta_magic.rb +0 -24
- data/spec/faked_project/lib/faked_project/some_class.rb +0 -28
- data/spec/faked_project/lib/faked_project/untested_class.rb +0 -11
- data/spec/faked_project/lib/faked_project.rb +0 -11
- data/spec/faked_project/spec/faked_spec.rb +0 -11
- data/spec/faked_project/spec/forking_spec.rb +0 -8
- data/spec/faked_project/spec/meta_magic_spec.rb +0 -15
- data/spec/faked_project/spec/some_class_spec.rb +0 -13
- data/spec/faked_project/spec/spec_helper.rb +0 -11
- data/spec/faked_project/test/faked_test.rb +0 -11
- data/spec/faked_project/test/meta_magic_test.rb +0 -13
- data/spec/faked_project/test/some_class_test.rb +0 -15
- data/spec/faked_project/test/test_helper.rb +0 -12
- data/spec/file_list_spec.rb +0 -50
- data/spec/filters_spec.rb +0 -172
- data/spec/fixtures/app/controllers/sample_controller.rb +0 -10
- data/spec/fixtures/app/models/user.rb +0 -10
- data/spec/fixtures/deleted_source_sample.rb +0 -15
- data/spec/fixtures/frameworks/rspec_bad.rb +0 -9
- data/spec/fixtures/frameworks/rspec_good.rb +0 -9
- data/spec/fixtures/frameworks/testunit_bad.rb +0 -9
- data/spec/fixtures/frameworks/testunit_good.rb +0 -9
- data/spec/fixtures/iso-8859.rb +0 -3
- data/spec/fixtures/never.rb +0 -2
- data/spec/fixtures/resultset1.rb +0 -4
- data/spec/fixtures/resultset2.rb +0 -4
- data/spec/fixtures/sample.rb +0 -16
- data/spec/fixtures/skipped.rb +0 -4
- data/spec/fixtures/skipped_and_executed.rb +0 -8
- data/spec/fixtures/utf-8.rb +0 -3
- data/spec/helper.rb +0 -26
- data/spec/last_run_spec.rb +0 -48
- data/spec/lines_classifier_spec.rb +0 -103
- data/spec/multi_formatter_spec.rb +0 -20
- data/spec/raw_coverage_spec.rb +0 -92
- data/spec/result_merger_spec.rb +0 -171
- data/spec/result_spec.rb +0 -209
- data/spec/return_codes_spec.rb +0 -34
- data/spec/simplecov_spec.rb +0 -109
- data/spec/source_file_line_spec.rb +0 -155
- data/spec/source_file_spec.rb +0 -145
- data/spec/support/fail_rspec_on_ruby_warning.rb +0 -75
data/lib/simplecov.rb
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "English"
|
|
4
|
+
|
|
1
5
|
#
|
|
2
6
|
# Code coverage for ruby 1.9. Please check out README for a full introduction.
|
|
3
7
|
#
|
|
@@ -20,6 +24,7 @@ module SimpleCov
|
|
|
20
24
|
class << self
|
|
21
25
|
attr_accessor :running
|
|
22
26
|
attr_accessor :pid
|
|
27
|
+
attr_reader :exit_exception
|
|
23
28
|
|
|
24
29
|
#
|
|
25
30
|
# Sets up SimpleCov to run against your project.
|
|
@@ -163,6 +168,92 @@ module SimpleCov
|
|
|
163
168
|
def clear_result
|
|
164
169
|
@result = nil
|
|
165
170
|
end
|
|
171
|
+
|
|
172
|
+
#
|
|
173
|
+
# Capture the current exception if it exists
|
|
174
|
+
# This will get called inside the at_exit block
|
|
175
|
+
#
|
|
176
|
+
def set_exit_exception
|
|
177
|
+
@exit_exception = $ERROR_INFO
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
#
|
|
181
|
+
# Returns the exit status from the exit exception
|
|
182
|
+
#
|
|
183
|
+
def exit_status_from_exception
|
|
184
|
+
return SimpleCov::ExitCodes::SUCCESS unless exit_exception
|
|
185
|
+
|
|
186
|
+
if exit_exception.is_a?(SystemExit)
|
|
187
|
+
exit_exception.status
|
|
188
|
+
else
|
|
189
|
+
SimpleCov::ExitCodes::EXCEPTION
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# @api private
|
|
194
|
+
#
|
|
195
|
+
# Called from at_exit block
|
|
196
|
+
#
|
|
197
|
+
def run_exit_tasks!
|
|
198
|
+
exit_status = SimpleCov.exit_status_from_exception
|
|
199
|
+
|
|
200
|
+
SimpleCov.at_exit.call
|
|
201
|
+
|
|
202
|
+
exit_status = SimpleCov.process_result(SimpleCov.result, exit_status)
|
|
203
|
+
|
|
204
|
+
# Force exit with stored status (see github issue #5)
|
|
205
|
+
# unless it's nil or 0 (see github issue #281)
|
|
206
|
+
Kernel.exit exit_status if exit_status && exit_status > 0
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# @api private
|
|
210
|
+
#
|
|
211
|
+
# Usage:
|
|
212
|
+
# exit_status = SimpleCov.process_result(SimpleCov.result, exit_status)
|
|
213
|
+
#
|
|
214
|
+
def process_result(result, exit_status)
|
|
215
|
+
return exit_status unless SimpleCov.result? # Result has been computed
|
|
216
|
+
return exit_status if exit_status != SimpleCov::ExitCodes::SUCCESS # Existing errors
|
|
217
|
+
|
|
218
|
+
covered_percent = result.covered_percent.round(2)
|
|
219
|
+
result_exit_status = result_exit_status(result, covered_percent)
|
|
220
|
+
if result_exit_status == SimpleCov::ExitCodes::SUCCESS # No result errors
|
|
221
|
+
write_last_run(covered_percent)
|
|
222
|
+
end
|
|
223
|
+
result_exit_status
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# @api private
|
|
227
|
+
#
|
|
228
|
+
# rubocop:disable Metrics/MethodLength
|
|
229
|
+
def result_exit_status(result, covered_percent)
|
|
230
|
+
covered_percentages = result.covered_percentages.map { |percentage| percentage.round(2) }
|
|
231
|
+
if covered_percent < SimpleCov.minimum_coverage
|
|
232
|
+
$stderr.printf("Coverage (%.2f%%) is below the expected minimum coverage (%.2f%%).\n", covered_percent, SimpleCov.minimum_coverage)
|
|
233
|
+
SimpleCov::ExitCodes::MINIMUM_COVERAGE
|
|
234
|
+
elsif covered_percentages.any? { |p| p < SimpleCov.minimum_coverage_by_file }
|
|
235
|
+
$stderr.printf("File (%s) is only (%.2f%%) covered. This is below the expected minimum coverage per file of (%.2f%%).\n", result.least_covered_file, covered_percentages.min, SimpleCov.minimum_coverage_by_file)
|
|
236
|
+
SimpleCov::ExitCodes::MINIMUM_COVERAGE
|
|
237
|
+
elsif (last_run = SimpleCov::LastRun.read)
|
|
238
|
+
coverage_diff = last_run["result"]["covered_percent"] - covered_percent
|
|
239
|
+
if coverage_diff > SimpleCov.maximum_coverage_drop
|
|
240
|
+
$stderr.printf("Coverage has dropped by %.2f%% since the last time (maximum allowed: %.2f%%).\n", coverage_diff, SimpleCov.maximum_coverage_drop)
|
|
241
|
+
SimpleCov::ExitCodes::MAXIMUM_COVERAGE_DROP
|
|
242
|
+
else
|
|
243
|
+
SimpleCov::ExitCodes::SUCCESS
|
|
244
|
+
end
|
|
245
|
+
else
|
|
246
|
+
SimpleCov::ExitCodes::SUCCESS
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
# rubocop:enable Metrics/MethodLength
|
|
250
|
+
|
|
251
|
+
#
|
|
252
|
+
# @api private
|
|
253
|
+
#
|
|
254
|
+
def write_last_run(covered_percent)
|
|
255
|
+
SimpleCov::LastRun.write(:result => {:covered_percent => covered_percent})
|
|
256
|
+
end
|
|
166
257
|
end
|
|
167
258
|
end
|
|
168
259
|
|
metadata
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simplecov
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.16.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christoph Olszowka
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-03-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: json
|
|
14
15
|
requirement: !ruby/object:Gem::Requirement
|
|
15
16
|
requirements:
|
|
16
17
|
- - ">="
|
|
@@ -19,9 +20,8 @@ dependencies:
|
|
|
19
20
|
- - "<"
|
|
20
21
|
- !ruby/object:Gem::Version
|
|
21
22
|
version: '3'
|
|
22
|
-
name: json
|
|
23
|
-
prerelease: false
|
|
24
23
|
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - ">="
|
|
@@ -31,42 +31,42 @@ dependencies:
|
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
32
|
version: '3'
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
|
+
name: simplecov-html
|
|
34
35
|
requirement: !ruby/object:Gem::Requirement
|
|
35
36
|
requirements:
|
|
36
37
|
- - "~>"
|
|
37
38
|
- !ruby/object:Gem::Version
|
|
38
39
|
version: 0.10.0
|
|
39
|
-
name: simplecov-html
|
|
40
|
-
prerelease: false
|
|
41
40
|
type: :runtime
|
|
41
|
+
prerelease: false
|
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
46
|
version: 0.10.0
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: docile
|
|
48
49
|
requirement: !ruby/object:Gem::Requirement
|
|
49
50
|
requirements:
|
|
50
51
|
- - "~>"
|
|
51
52
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: 1.1
|
|
53
|
-
name: docile
|
|
54
|
-
prerelease: false
|
|
53
|
+
version: '1.1'
|
|
55
54
|
type: :runtime
|
|
55
|
+
prerelease: false
|
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
57
|
requirements:
|
|
58
58
|
- - "~>"
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: 1.1
|
|
60
|
+
version: '1.1'
|
|
61
61
|
- !ruby/object:Gem::Dependency
|
|
62
|
+
name: bundler
|
|
62
63
|
requirement: !ruby/object:Gem::Requirement
|
|
63
64
|
requirements:
|
|
64
65
|
- - "~>"
|
|
65
66
|
- !ruby/object:Gem::Version
|
|
66
67
|
version: '1.9'
|
|
67
|
-
name: bundler
|
|
68
|
-
prerelease: false
|
|
69
68
|
type: :development
|
|
69
|
+
prerelease: false
|
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
|
71
71
|
requirements:
|
|
72
72
|
- - "~>"
|
|
@@ -80,57 +80,13 @@ executables: []
|
|
|
80
80
|
extensions: []
|
|
81
81
|
extra_rdoc_files: []
|
|
82
82
|
files:
|
|
83
|
-
- ".gitignore"
|
|
84
|
-
- ".rspec"
|
|
85
|
-
- ".rubocop.yml"
|
|
86
|
-
- ".travis.yml"
|
|
87
|
-
- ".yardopts"
|
|
88
83
|
- CHANGELOG.md
|
|
89
84
|
- CONTRIBUTING.md
|
|
90
|
-
-
|
|
91
|
-
- MIT-LICENSE
|
|
85
|
+
- ISSUE_TEMPLATE.md
|
|
92
86
|
- README.md
|
|
93
|
-
- Rakefile
|
|
94
|
-
- cucumber.yml
|
|
95
87
|
- doc/alternate-formatters.md
|
|
96
88
|
- doc/commercial-services.md
|
|
97
89
|
- doc/editor-integration.md
|
|
98
|
-
- features/config_autoload.feature
|
|
99
|
-
- features/config_command_name.feature
|
|
100
|
-
- features/config_coverage_dir.feature
|
|
101
|
-
- features/config_deactivate_merging.feature
|
|
102
|
-
- features/config_formatters.feature
|
|
103
|
-
- features/config_merge_timeout.feature
|
|
104
|
-
- features/config_nocov_token.feature
|
|
105
|
-
- features/config_profiles.feature
|
|
106
|
-
- features/config_project_name.feature
|
|
107
|
-
- features/config_styles.feature
|
|
108
|
-
- features/config_tracked_files.feature
|
|
109
|
-
- features/config_tracked_files_relevant_lines.feature
|
|
110
|
-
- features/cucumber_basic.feature
|
|
111
|
-
- features/maximum_coverage_drop.feature
|
|
112
|
-
- features/merging_test_unit_and_rspec.feature
|
|
113
|
-
- features/minimum_coverage.feature
|
|
114
|
-
- features/refuse_coverage_drop.feature
|
|
115
|
-
- features/rspec_basic.feature
|
|
116
|
-
- features/rspec_fails_on_initialization.feature
|
|
117
|
-
- features/rspec_groups_and_filters_basic.feature
|
|
118
|
-
- features/rspec_groups_and_filters_complex.feature
|
|
119
|
-
- features/rspec_groups_using_filter_class.feature
|
|
120
|
-
- features/rspec_without_simplecov.feature
|
|
121
|
-
- features/skipping_code_blocks_manually.feature
|
|
122
|
-
- features/step_definitions/html_steps.rb
|
|
123
|
-
- features/step_definitions/simplecov_steps.rb
|
|
124
|
-
- features/step_definitions/transformers.rb
|
|
125
|
-
- features/step_definitions/web_steps.rb
|
|
126
|
-
- features/support/aruba_freedom_patch.rb
|
|
127
|
-
- features/support/env.rb
|
|
128
|
-
- features/test_unit_basic.feature
|
|
129
|
-
- features/test_unit_groups_and_filters_basic.feature
|
|
130
|
-
- features/test_unit_groups_and_filters_complex.feature
|
|
131
|
-
- features/test_unit_groups_using_filter_class.feature
|
|
132
|
-
- features/test_unit_without_simplecov.feature
|
|
133
|
-
- features/unicode_compatiblity.feature
|
|
134
90
|
- lib/simplecov.rb
|
|
135
91
|
- lib/simplecov/command_guesser.rb
|
|
136
92
|
- lib/simplecov/configuration.rb
|
|
@@ -147,6 +103,10 @@ files:
|
|
|
147
103
|
- lib/simplecov/load_global_config.rb
|
|
148
104
|
- lib/simplecov/no_defaults.rb
|
|
149
105
|
- lib/simplecov/profiles.rb
|
|
106
|
+
- lib/simplecov/profiles/bundler_filter.rb
|
|
107
|
+
- lib/simplecov/profiles/rails.rb
|
|
108
|
+
- lib/simplecov/profiles/root_filter.rb
|
|
109
|
+
- lib/simplecov/profiles/test_frameworks.rb
|
|
150
110
|
- lib/simplecov/railtie.rb
|
|
151
111
|
- lib/simplecov/railties/tasks.rake
|
|
152
112
|
- lib/simplecov/raw_coverage.rb
|
|
@@ -154,66 +114,11 @@ files:
|
|
|
154
114
|
- lib/simplecov/result_merger.rb
|
|
155
115
|
- lib/simplecov/source_file.rb
|
|
156
116
|
- lib/simplecov/version.rb
|
|
157
|
-
- simplecov.gemspec
|
|
158
|
-
- spec/1_8_fallbacks_spec.rb
|
|
159
|
-
- spec/command_guesser_spec.rb
|
|
160
|
-
- spec/config_loader_spec.rb
|
|
161
|
-
- spec/configuration_spec.rb
|
|
162
|
-
- spec/deleted_source_spec.rb
|
|
163
|
-
- spec/faked_project/Gemfile
|
|
164
|
-
- spec/faked_project/Rakefile
|
|
165
|
-
- spec/faked_project/cucumber.yml
|
|
166
|
-
- spec/faked_project/features/step_definitions/my_steps.rb
|
|
167
|
-
- spec/faked_project/features/support/env.rb
|
|
168
|
-
- spec/faked_project/features/test_stuff.feature
|
|
169
|
-
- spec/faked_project/lib/faked_project.rb
|
|
170
|
-
- spec/faked_project/lib/faked_project/framework_specific.rb
|
|
171
|
-
- spec/faked_project/lib/faked_project/meta_magic.rb
|
|
172
|
-
- spec/faked_project/lib/faked_project/some_class.rb
|
|
173
|
-
- spec/faked_project/lib/faked_project/untested_class.rb
|
|
174
|
-
- spec/faked_project/spec/faked_spec.rb
|
|
175
|
-
- spec/faked_project/spec/forking_spec.rb
|
|
176
|
-
- spec/faked_project/spec/meta_magic_spec.rb
|
|
177
|
-
- spec/faked_project/spec/some_class_spec.rb
|
|
178
|
-
- spec/faked_project/spec/spec_helper.rb
|
|
179
|
-
- spec/faked_project/test/faked_test.rb
|
|
180
|
-
- spec/faked_project/test/meta_magic_test.rb
|
|
181
|
-
- spec/faked_project/test/some_class_test.rb
|
|
182
|
-
- spec/faked_project/test/test_helper.rb
|
|
183
|
-
- spec/file_list_spec.rb
|
|
184
|
-
- spec/filters_spec.rb
|
|
185
|
-
- spec/fixtures/app/controllers/sample_controller.rb
|
|
186
|
-
- spec/fixtures/app/models/user.rb
|
|
187
|
-
- spec/fixtures/deleted_source_sample.rb
|
|
188
|
-
- spec/fixtures/frameworks/rspec_bad.rb
|
|
189
|
-
- spec/fixtures/frameworks/rspec_good.rb
|
|
190
|
-
- spec/fixtures/frameworks/testunit_bad.rb
|
|
191
|
-
- spec/fixtures/frameworks/testunit_good.rb
|
|
192
|
-
- spec/fixtures/iso-8859.rb
|
|
193
|
-
- spec/fixtures/never.rb
|
|
194
|
-
- spec/fixtures/resultset1.rb
|
|
195
|
-
- spec/fixtures/resultset2.rb
|
|
196
|
-
- spec/fixtures/sample.rb
|
|
197
|
-
- spec/fixtures/skipped.rb
|
|
198
|
-
- spec/fixtures/skipped_and_executed.rb
|
|
199
|
-
- spec/fixtures/utf-8.rb
|
|
200
|
-
- spec/helper.rb
|
|
201
|
-
- spec/last_run_spec.rb
|
|
202
|
-
- spec/lines_classifier_spec.rb
|
|
203
|
-
- spec/multi_formatter_spec.rb
|
|
204
|
-
- spec/raw_coverage_spec.rb
|
|
205
|
-
- spec/result_merger_spec.rb
|
|
206
|
-
- spec/result_spec.rb
|
|
207
|
-
- spec/return_codes_spec.rb
|
|
208
|
-
- spec/simplecov_spec.rb
|
|
209
|
-
- spec/source_file_line_spec.rb
|
|
210
|
-
- spec/source_file_spec.rb
|
|
211
|
-
- spec/support/fail_rspec_on_ruby_warning.rb
|
|
212
117
|
homepage: http://github.com/colszowka/simplecov
|
|
213
118
|
licenses:
|
|
214
119
|
- MIT
|
|
215
120
|
metadata: {}
|
|
216
|
-
post_install_message:
|
|
121
|
+
post_install_message:
|
|
217
122
|
rdoc_options: []
|
|
218
123
|
require_paths:
|
|
219
124
|
- lib
|
|
@@ -228,9 +133,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
228
133
|
- !ruby/object:Gem::Version
|
|
229
134
|
version: '0'
|
|
230
135
|
requirements: []
|
|
231
|
-
rubyforge_project:
|
|
232
|
-
rubygems_version: 2.6.
|
|
233
|
-
signing_key:
|
|
136
|
+
rubyforge_project:
|
|
137
|
+
rubygems_version: 2.6.13
|
|
138
|
+
signing_key:
|
|
234
139
|
specification_version: 4
|
|
235
140
|
summary: Code coverage for Ruby 1.9+ with a powerful configuration library and automatic
|
|
236
141
|
merging of coverage across test suites
|
data/.gitignore
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
.bundle
|
|
2
|
-
Gemfile.lock
|
|
3
|
-
gemfiles/*.lock
|
|
4
|
-
|
|
5
|
-
## MAC OS
|
|
6
|
-
.DS_Store
|
|
7
|
-
.document
|
|
8
|
-
|
|
9
|
-
## TEXTMATE
|
|
10
|
-
*.tmproj
|
|
11
|
-
tmtags
|
|
12
|
-
|
|
13
|
-
## EMACS
|
|
14
|
-
*~
|
|
15
|
-
\#*
|
|
16
|
-
.\#*
|
|
17
|
-
|
|
18
|
-
## VIM
|
|
19
|
-
*.swp
|
|
20
|
-
|
|
21
|
-
## PROJECT::GENERAL
|
|
22
|
-
coverage
|
|
23
|
-
rdoc
|
|
24
|
-
pkg
|
|
25
|
-
tmp
|
|
26
|
-
capybara*.html
|
|
27
|
-
.rvmrc
|
|
28
|
-
|
|
29
|
-
## PROJECT::SPECIFIC
|
|
30
|
-
|
|
31
|
-
.yardoc
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
AllCops:
|
|
2
|
-
Exclude:
|
|
3
|
-
- 'spec/fixtures/iso-8859.rb'
|
|
4
|
-
- 'tmp/**/*'
|
|
5
|
-
- 'vendor/bundle/**/*'
|
|
6
|
-
TargetRubyVersion: 1.9
|
|
7
|
-
|
|
8
|
-
Bundler/OrderedGems:
|
|
9
|
-
Enabled: false
|
|
10
|
-
|
|
11
|
-
Lint/AmbiguousRegexpLiteral:
|
|
12
|
-
Exclude:
|
|
13
|
-
- 'features/**/*_steps.rb'
|
|
14
|
-
- 'spec/**/*_steps.rb'
|
|
15
|
-
- 'tmp/**/*_steps.rb'
|
|
16
|
-
|
|
17
|
-
Metrics/AbcSize:
|
|
18
|
-
Max: 25 # TODO: Lower to 15
|
|
19
|
-
|
|
20
|
-
Metrics/BlockLength:
|
|
21
|
-
Exclude:
|
|
22
|
-
- 'spec/**/*.rb'
|
|
23
|
-
|
|
24
|
-
Metrics/BlockNesting:
|
|
25
|
-
Max: 2
|
|
26
|
-
|
|
27
|
-
Metrics/LineLength:
|
|
28
|
-
AllowURI: true
|
|
29
|
-
Enabled: false
|
|
30
|
-
|
|
31
|
-
Metrics/MethodLength:
|
|
32
|
-
CountComments: false
|
|
33
|
-
Max: 12 # TODO: Lower to 10
|
|
34
|
-
|
|
35
|
-
Metrics/ParameterLists:
|
|
36
|
-
Max: 4
|
|
37
|
-
CountKeywordArgs: true
|
|
38
|
-
|
|
39
|
-
Layout/AccessModifierIndentation:
|
|
40
|
-
EnforcedStyle: outdent
|
|
41
|
-
|
|
42
|
-
Style/CollectionMethods:
|
|
43
|
-
PreferredMethods:
|
|
44
|
-
map: 'collect'
|
|
45
|
-
reduce: 'inject'
|
|
46
|
-
find: 'detect'
|
|
47
|
-
find_all: 'select'
|
|
48
|
-
|
|
49
|
-
Style/Documentation:
|
|
50
|
-
Enabled: false
|
|
51
|
-
|
|
52
|
-
Style/DoubleNegation:
|
|
53
|
-
Enabled: false
|
|
54
|
-
|
|
55
|
-
Style/HashSyntax:
|
|
56
|
-
EnforcedStyle: hash_rockets
|
|
57
|
-
|
|
58
|
-
Layout/IndentHeredoc:
|
|
59
|
-
Enabled: false
|
|
60
|
-
|
|
61
|
-
Style/RegexpLiteral:
|
|
62
|
-
Enabled: false
|
|
63
|
-
|
|
64
|
-
Layout/SpaceInsideHashLiteralBraces:
|
|
65
|
-
EnforcedStyle: no_space
|
|
66
|
-
|
|
67
|
-
Style/SpecialGlobalVars:
|
|
68
|
-
Exclude:
|
|
69
|
-
- 'spec/deleted_source_spec.rb'
|
|
70
|
-
- 'spec/return_codes_spec.rb'
|
|
71
|
-
- 'lib/simplecov/defaults.rb'
|
|
72
|
-
|
|
73
|
-
Style/StringLiterals:
|
|
74
|
-
EnforcedStyle: double_quotes
|
|
75
|
-
|
|
76
|
-
Style/FileName:
|
|
77
|
-
Exclude:
|
|
78
|
-
- 'spec/fixtures/utf-8.rb'
|
|
79
|
-
|
|
80
|
-
Style/TrailingCommaInLiteral:
|
|
81
|
-
EnforcedStyleForMultiline: comma
|
|
82
|
-
|
|
83
|
-
Style/GuardClause:
|
|
84
|
-
Enabled: false
|
|
85
|
-
|
|
86
|
-
Style/MutableConstant:
|
|
87
|
-
Exclude:
|
|
88
|
-
- 'lib/simplecov/version.rb' # required for older versions of rubygems
|
data/.travis.yml
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
language: ruby
|
|
2
|
-
|
|
3
|
-
before_install:
|
|
4
|
-
- gem update --system
|
|
5
|
-
- gem install bundler
|
|
6
|
-
|
|
7
|
-
bundler_args: --without development --jobs=3 --retry=3
|
|
8
|
-
|
|
9
|
-
cache: bundler
|
|
10
|
-
|
|
11
|
-
sudo: false
|
|
12
|
-
|
|
13
|
-
rvm:
|
|
14
|
-
- 1.8.7
|
|
15
|
-
- 1.9.3
|
|
16
|
-
- 2.0.0
|
|
17
|
-
- 2.1.10
|
|
18
|
-
- 2.2.7
|
|
19
|
-
- 2.3.4
|
|
20
|
-
- 2.4.1
|
|
21
|
-
- jruby-9.1.12.0
|
|
22
|
-
- ruby-head
|
|
23
|
-
- jruby-head
|
|
24
|
-
|
|
25
|
-
matrix:
|
|
26
|
-
allow_failures:
|
|
27
|
-
- rvm: ruby-head
|
|
28
|
-
- rvm: jruby-head
|
|
29
|
-
fast_finish: true
|
data/.yardopts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
- **/*.md
|
data/Gemfile
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
source "https://rubygems.org"
|
|
2
|
-
|
|
3
|
-
# Uncomment this to use local copy of simplecov-html in development when checked out
|
|
4
|
-
# gem 'simplecov-html', :path => ::File.dirname(__FILE__) + '/../simplecov-html'
|
|
5
|
-
|
|
6
|
-
# Uncomment this to use development version of html formatter from github
|
|
7
|
-
# gem 'simplecov-html', :github => 'colszowka/simplecov-html'
|
|
8
|
-
|
|
9
|
-
gem "rake", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("1.9.3") ? "~>10.3" : ">= 10.3"
|
|
10
|
-
|
|
11
|
-
group :test do
|
|
12
|
-
gem "rspec", ">= 3.2"
|
|
13
|
-
# Older versions of some gems required for Ruby 1.8.7 support
|
|
14
|
-
platforms :ruby_18 do
|
|
15
|
-
gem "activesupport", "~> 3.2.21"
|
|
16
|
-
gem "i18n", "~> 0.6.11"
|
|
17
|
-
end
|
|
18
|
-
platforms :ruby_18, :ruby_19 do
|
|
19
|
-
gem "mime-types", "~> 1.25"
|
|
20
|
-
gem "addressable", "~> 2.3.0"
|
|
21
|
-
end
|
|
22
|
-
platforms :ruby_18, :ruby_19, :ruby_20, :ruby_21 do
|
|
23
|
-
gem "rack", "~> 1.6"
|
|
24
|
-
end
|
|
25
|
-
platforms :jruby, :ruby_19, :ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24, :ruby_25 do
|
|
26
|
-
gem "aruba", "~> 0.14"
|
|
27
|
-
gem "capybara"
|
|
28
|
-
gem "nokogiri", RUBY_VERSION < "2.1" ? "~> 1.6.0" : ">= 1.7"
|
|
29
|
-
gem "cucumber"
|
|
30
|
-
gem "phantomjs", "~> 2.1"
|
|
31
|
-
gem "poltergeist"
|
|
32
|
-
gem "rubocop", "0.49.1" unless RUBY_VERSION.start_with?("1.")
|
|
33
|
-
gem "test-unit"
|
|
34
|
-
end
|
|
35
|
-
gem "json", RUBY_VERSION.start_with?("1.") ? "~> 1.8" : "~> 2.0"
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
gemspec
|
data/MIT-LICENSE
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2010-2017 Christoph Olszowka
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
-
a copy of this software and associated documentation files (the
|
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
-
the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be
|
|
12
|
-
included in all copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env rake
|
|
2
|
-
|
|
3
|
-
require "rubygems"
|
|
4
|
-
require "bundler/setup"
|
|
5
|
-
Bundler::GemHelper.install_tasks
|
|
6
|
-
|
|
7
|
-
# See https://github.com/colszowka/simplecov/issues/171
|
|
8
|
-
desc "Set permissions on all files so they are compatible with both user-local and system-wide installs"
|
|
9
|
-
task :fix_permissions do
|
|
10
|
-
system 'bash -c "find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;"'
|
|
11
|
-
end
|
|
12
|
-
# Enforce proper permissions on each build
|
|
13
|
-
Rake::Task[:build].prerequisites.unshift :fix_permissions
|
|
14
|
-
|
|
15
|
-
require "rspec/core/rake_task"
|
|
16
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
17
|
-
spec.pattern = FileList["spec/*_spec.rb"]
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
begin
|
|
21
|
-
require "rubocop/rake_task"
|
|
22
|
-
RuboCop::RakeTask.new
|
|
23
|
-
rescue LoadError
|
|
24
|
-
task :rubocop do
|
|
25
|
-
$stderr.puts "Rubocop is disabled"
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# Cucumber integration test suite is for impls that work with simplecov only - a.k.a. 1.9+
|
|
30
|
-
if RUBY_VERSION.start_with? "1.8"
|
|
31
|
-
task :default => [:spec]
|
|
32
|
-
else
|
|
33
|
-
require "cucumber/rake/task"
|
|
34
|
-
Cucumber::Rake::Task.new
|
|
35
|
-
|
|
36
|
-
if RUBY_VERSION.start_with? "1.9"
|
|
37
|
-
task :default => [:spec, :cucumber]
|
|
38
|
-
else
|
|
39
|
-
task :default => [:rubocop, :spec, :cucumber]
|
|
40
|
-
end
|
|
41
|
-
end
|
data/cucumber.yml
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
|
3
|
-
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
|
4
|
-
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
|
|
5
|
-
interp_opts = if defined?(RUBY_ENGINE)
|
|
6
|
-
" --tags ~@exclude-#{RUBY_ENGINE}"
|
|
7
|
-
else
|
|
8
|
-
''
|
|
9
|
-
end
|
|
10
|
-
%>
|
|
11
|
-
default: <%= std_opts %><%= interp_opts %> features
|
|
12
|
-
wip: --tags @wip:30 --wip features<%= interp_opts %>
|
|
13
|
-
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip<%= interp_opts %>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
@test_unit @rspec @config
|
|
2
|
-
Feature:
|
|
3
|
-
|
|
4
|
-
If you have multiple test suites, it can be a bit cumbersome
|
|
5
|
-
to keep the configuration across them in sync. SimpleCov
|
|
6
|
-
is able to find a config file called '.simplecov' that resides
|
|
7
|
-
in your project's root and will automatically use it when
|
|
8
|
-
loaded.
|
|
9
|
-
|
|
10
|
-
This gives you the ability to configure SimpleCov just once
|
|
11
|
-
and then use the same configuration on all test suites simply
|
|
12
|
-
by doing a 'require "simplecov"'
|
|
13
|
-
|
|
14
|
-
Scenario:
|
|
15
|
-
Given a file named ".simplecov" with:
|
|
16
|
-
"""
|
|
17
|
-
SimpleCov.start do
|
|
18
|
-
add_filter 'test.rb'
|
|
19
|
-
add_filter 'spec.rb'
|
|
20
|
-
end
|
|
21
|
-
"""
|
|
22
|
-
Given SimpleCov for Test/Unit is configured with:
|
|
23
|
-
"""
|
|
24
|
-
require 'simplecov'
|
|
25
|
-
"""
|
|
26
|
-
Given SimpleCov for RSpec is configured with:
|
|
27
|
-
"""
|
|
28
|
-
require 'simplecov'
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
When I successfully run `bundle exec rake test`
|
|
32
|
-
And I open the coverage report generated with `bundle exec rspec spec`
|
|
33
|
-
Then the report should be based upon:
|
|
34
|
-
| RSpec |
|
|
35
|
-
| Unit Tests |
|
|
36
|
-
|
|
37
|
-
And I should see the groups:
|
|
38
|
-
| name | coverage | files |
|
|
39
|
-
| All Files | 90.48% | 4 |
|
|
40
|
-
|
|
41
|
-
And I should see the source files:
|
|
42
|
-
| name | coverage |
|
|
43
|
-
| lib/faked_project.rb | 100.0 % |
|
|
44
|
-
| lib/faked_project/some_class.rb | 80.0 % |
|
|
45
|
-
| lib/faked_project/framework_specific.rb | 87.5 % |
|
|
46
|
-
| lib/faked_project/meta_magic.rb | 100.0 % |
|