single_cov 0.1.2 → 0.2.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/lib/single_cov/version.rb +1 -1
- data/lib/single_cov.rb +13 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e19ed01ef24061fbfa704ed22e38f4c8f1156c3d
|
4
|
+
data.tar.gz: cd7cff955cbd605b7d141e7e30ffc3c29d9e5420
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 072530285e1f8eb1a5890f0ac16d9c31bf64d17b806cb71b973ccc5968c77ee1ab9c0bb63ad1557715629e46e291c97c69088d9edef0e2c54240b2686b287409
|
7
|
+
data.tar.gz: 962918212ffbffe7fba4a309d77993a1e7fac7e1093a4c3f3b9b87af444194fe1554683f8bfb7ef2d16af8464f354c7820f3f59fc44713085ef1bee1189c869f
|
data/lib/single_cov/version.rb
CHANGED
data/lib/single_cov.rb
CHANGED
@@ -62,14 +62,17 @@ module SingleCov
|
|
62
62
|
when :minitest
|
63
63
|
minitest_should_not_be_running!
|
64
64
|
return if minitest_running_subset_of_tests?
|
65
|
-
|
66
|
-
|
67
|
-
override_at_exit do |status, _exception|
|
68
|
-
exit 1 if status == 0 && !SingleCov.all_covered?(coverage_results)
|
69
|
-
end
|
65
|
+
when :rspec
|
66
|
+
return if rspec_running_subset_of_tests?
|
70
67
|
else
|
71
68
|
raise "Unsupported framework #{framework.inspect}"
|
72
69
|
end
|
70
|
+
|
71
|
+
start_coverage_recording
|
72
|
+
|
73
|
+
override_at_exit do |status, _exception|
|
74
|
+
exit 1 if status == 0 && !SingleCov.all_covered?(coverage_results)
|
75
|
+
end
|
73
76
|
end
|
74
77
|
|
75
78
|
private
|
@@ -112,6 +115,10 @@ module SingleCov
|
|
112
115
|
(ARGV & ['-n', '--name', '-l', '--line']).any?
|
113
116
|
end
|
114
117
|
|
118
|
+
def rspec_running_subset_of_tests?
|
119
|
+
(ARGV & ['-t', '--tag', '-e', '--example']).any? || ARGV.any? { |a| a =~ /\:\d+$/ }
|
120
|
+
end
|
121
|
+
|
115
122
|
# code stolen from SimpleCov
|
116
123
|
def override_at_exit
|
117
124
|
at_exit do
|
@@ -179,7 +186,7 @@ module SingleCov
|
|
179
186
|
file = file.dup
|
180
187
|
|
181
188
|
# remove project root
|
182
|
-
file.sub!("#{
|
189
|
+
file.sub!("#{Dir.pwd}/", '')
|
183
190
|
|
184
191
|
# remove caller junk to get nice error messages when something fails
|
185
192
|
file.sub!(/\.rb\b.*/, '.rb')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: single_cov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|