simplecov 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/.rvmrc +1 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +34 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/simplecov/result.rb +13 -4
- data/simplecov.gemspec +8 -5
- data/test/helper.rb +2 -0
- data/test/test_result.rb +4 -3
- metadata +7 -6
data/.gitignore
CHANGED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.2
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
diff-lcs (1.1.2)
|
5
|
+
gemcutter (0.6.1)
|
6
|
+
git (1.2.5)
|
7
|
+
jeweler (1.4.0)
|
8
|
+
gemcutter (>= 0.1.0)
|
9
|
+
git (>= 1.2.5)
|
10
|
+
rubyforge (>= 2.0.0)
|
11
|
+
json_pure (1.4.6)
|
12
|
+
rspec (2.0.1)
|
13
|
+
rspec-core (~> 2.0.1)
|
14
|
+
rspec-expectations (~> 2.0.1)
|
15
|
+
rspec-mocks (~> 2.0.1)
|
16
|
+
rspec-core (2.0.1)
|
17
|
+
rspec-expectations (2.0.1)
|
18
|
+
diff-lcs (>= 1.1.2)
|
19
|
+
rspec-mocks (2.0.1)
|
20
|
+
rspec-core (~> 2.0.1)
|
21
|
+
rspec-expectations (~> 2.0.1)
|
22
|
+
rubyforge (2.0.4)
|
23
|
+
json_pure (>= 1.1.7)
|
24
|
+
shoulda (2.10.3)
|
25
|
+
simplecov-html (0.3.8)
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
ruby
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
jeweler (= 1.4.0)
|
32
|
+
rspec (~> 2.0.0)
|
33
|
+
shoulda (= 2.10.3)
|
34
|
+
simplecov-html (>= 0.3.7)
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ begin
|
|
12
12
|
gem.authors = ["Christoph Olszowka"]
|
13
13
|
gem.add_dependency 'simplecov-html', ">= 0.3.7"
|
14
14
|
gem.add_development_dependency "shoulda", "2.10.3"
|
15
|
-
gem.add_development_dependency "rspec", "~> 2.0.0
|
15
|
+
gem.add_development_dependency "rspec", "~> 2.0.0"
|
16
16
|
gem.add_development_dependency "jeweler", "1.4.0"
|
17
17
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
18
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.7
|
data/lib/simplecov/result.rb
CHANGED
@@ -36,10 +36,19 @@ module SimpleCov
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# The overall percentual coverage for this result
|
39
|
-
#
|
40
|
-
# FIXME: Kind of inaccurate - should use LOC instead of Files count!
|
41
39
|
def covered_percent
|
42
|
-
|
40
|
+
missed_lines, covered_lines = 0, 0
|
41
|
+
@files.each do |file|
|
42
|
+
original_result[file.filename].each do |line_result|
|
43
|
+
case line_result
|
44
|
+
when 0
|
45
|
+
missed_lines += 1
|
46
|
+
when 1
|
47
|
+
covered_lines += 1
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
100.0 * covered_lines / (missed_lines + covered_lines)
|
43
52
|
end
|
44
53
|
|
45
54
|
# Applies the configured SimpleCov.formatter on this result
|
@@ -89,4 +98,4 @@ module SimpleCov
|
|
89
98
|
@files = SimpleCov.filtered(files)
|
90
99
|
end
|
91
100
|
end
|
92
|
-
end
|
101
|
+
end
|
data/simplecov.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{simplecov}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Christoph Olszowka"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-06}
|
13
13
|
s.description = %q{Code coverage for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites}
|
14
14
|
s.email = %q{christoph at olszowka de}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -19,6 +19,9 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
".gitignore",
|
22
|
+
".rvmrc",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
22
25
|
"LICENSE",
|
23
26
|
"README.rdoc",
|
24
27
|
"Rakefile",
|
@@ -85,18 +88,18 @@ Gem::Specification.new do |s|
|
|
85
88
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
86
89
|
s.add_runtime_dependency(%q<simplecov-html>, [">= 0.3.7"])
|
87
90
|
s.add_development_dependency(%q<shoulda>, ["= 2.10.3"])
|
88
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.0.0
|
91
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.0.0"])
|
89
92
|
s.add_development_dependency(%q<jeweler>, ["= 1.4.0"])
|
90
93
|
else
|
91
94
|
s.add_dependency(%q<simplecov-html>, [">= 0.3.7"])
|
92
95
|
s.add_dependency(%q<shoulda>, ["= 2.10.3"])
|
93
|
-
s.add_dependency(%q<rspec>, ["~> 2.0.0
|
96
|
+
s.add_dependency(%q<rspec>, ["~> 2.0.0"])
|
94
97
|
s.add_dependency(%q<jeweler>, ["= 1.4.0"])
|
95
98
|
end
|
96
99
|
else
|
97
100
|
s.add_dependency(%q<simplecov-html>, [">= 0.3.7"])
|
98
101
|
s.add_dependency(%q<shoulda>, ["= 2.10.3"])
|
99
|
-
s.add_dependency(%q<rspec>, ["~> 2.0.0
|
102
|
+
s.add_dependency(%q<rspec>, ["~> 2.0.0"])
|
100
103
|
s.add_dependency(%q<jeweler>, ["= 1.4.0"])
|
101
104
|
end
|
102
105
|
end
|
data/test/helper.rb
CHANGED
data/test/test_result.rb
CHANGED
@@ -27,8 +27,9 @@ class TestResult < Test::Unit::TestCase
|
|
27
27
|
assert_equal @result.files, @result.source_files
|
28
28
|
end
|
29
29
|
|
30
|
-
should "have
|
31
|
-
|
30
|
+
should "have accurate covered percent" do
|
31
|
+
# in our fixture, there are 13 covered line (result in 1) in all 15 relevant line (result in non-nil)
|
32
|
+
assert_equal 100.0*13/15, @result.covered_percent
|
32
33
|
end
|
33
34
|
|
34
35
|
context "dumped with to_yaml" do
|
@@ -130,4 +131,4 @@ class TestResult < Test::Unit::TestCase
|
|
130
131
|
end
|
131
132
|
end
|
132
133
|
end
|
133
|
-
end
|
134
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 7
|
9
|
+
version: 0.3.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Christoph Olszowka
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-11-06 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -59,9 +59,7 @@ dependencies:
|
|
59
59
|
- 2
|
60
60
|
- 0
|
61
61
|
- 0
|
62
|
-
|
63
|
-
- 20
|
64
|
-
version: 2.0.0.beta.20
|
62
|
+
version: 2.0.0
|
65
63
|
type: :development
|
66
64
|
version_requirements: *id003
|
67
65
|
- !ruby/object:Gem::Dependency
|
@@ -91,6 +89,9 @@ extra_rdoc_files:
|
|
91
89
|
files:
|
92
90
|
- .document
|
93
91
|
- .gitignore
|
92
|
+
- .rvmrc
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
94
95
|
- LICENSE
|
95
96
|
- README.rdoc
|
96
97
|
- Rakefile
|