coveralls 0.8.3 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/lib/coveralls/simplecov.rb +22 -26
- data/lib/coveralls/version.rb +1 -1
- data/spec/coveralls/fixtures/app/controllers/sample.rb +4 -2
- data/spec/coveralls/fixtures/sample.rb +2 -0
- data/spec/coveralls/simplecov_spec.rb +9 -1
- data/spec/spec_helper.rb +2 -0
- 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: 766530ea38e74bb4d1a38671945a41f572aa063b
|
4
|
+
data.tar.gz: 51352ecb98eb89ba741000a4efd3accb9c946f23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b41e904e1aca79f3179b8aaf45fbcc7ac501e11a414819f6034031cf6aef57c8738958b9f5d30b9e1980d1f06c434864792651ca8806c6d0c813ff392af4fcb6
|
7
|
+
data.tar.gz: 0012c11f145c1309224430ca2263d78b6b2c58f7ad2b8415356b1c9f9fb1cb66ec8624411e295b49f0209cb00161b2c6beb154fe82df6718970ab7c11af8fb05
|
data/Gemfile
CHANGED
data/lib/coveralls/simplecov.rb
CHANGED
@@ -26,15 +26,7 @@ module Coveralls
|
|
26
26
|
true
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
30
|
-
|
31
|
-
unless Coveralls.should_run?
|
32
|
-
if Coveralls.noisy?
|
33
|
-
display_result result
|
34
|
-
end
|
35
|
-
return
|
36
|
-
end
|
37
|
-
|
29
|
+
def get_source_files(result)
|
38
30
|
# Gather the source files.
|
39
31
|
source_files = []
|
40
32
|
result.files.each do |file|
|
@@ -47,29 +39,33 @@ module Coveralls
|
|
47
39
|
properties[:name] = short_filename(file.filename)
|
48
40
|
|
49
41
|
# Get the coverage
|
50
|
-
properties[:coverage] = file.coverage
|
51
|
-
|
52
|
-
#
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
# if grouped_files.map(&:filename).include?(file.filename)
|
57
|
-
# properties[:group] = group_name
|
58
|
-
# break
|
59
|
-
# end
|
60
|
-
# end
|
42
|
+
properties[:coverage] = file.coverage.dup
|
43
|
+
|
44
|
+
# Skip nocov lines
|
45
|
+
file.lines.each_with_index do |line, i|
|
46
|
+
properties[:coverage][i] = nil if line.skipped?
|
47
|
+
end
|
61
48
|
|
62
49
|
source_files << properties
|
63
50
|
end
|
51
|
+
source_files
|
52
|
+
end
|
53
|
+
|
54
|
+
def format(result)
|
64
55
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
56
|
+
unless Coveralls.should_run?
|
57
|
+
if Coveralls.noisy?
|
58
|
+
display_result result
|
59
|
+
end
|
60
|
+
return
|
61
|
+
end
|
70
62
|
|
71
63
|
# Post to Coveralls.
|
72
|
-
API.post_json "jobs",
|
64
|
+
API.post_json "jobs",
|
65
|
+
:source_files => get_source_files(result),
|
66
|
+
:test_framework => result.command_name.downcase,
|
67
|
+
:run_at => result.created_at
|
68
|
+
|
73
69
|
Coveralls::Output.puts output_message result
|
74
70
|
|
75
71
|
true
|
data/lib/coveralls/version.rb
CHANGED
@@ -19,7 +19,7 @@ describe Coveralls::SimpleCov::Formatter do
|
|
19
19
|
source_fixture( 'app/models/house.rb' ) => [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil],
|
20
20
|
source_fixture( 'app/models/airplane.rb' ) => [0, 0, 0, 0, 0],
|
21
21
|
source_fixture( 'app/models/dog.rb' ) => [1, 1, 1, 1, 1],
|
22
|
-
source_fixture( 'app/controllers/sample.rb' ) => [nil, 1, 1, 1, nil,
|
22
|
+
source_fixture( 'app/controllers/sample.rb' ) => [nil, 1, 1, 1, nil, 0, 1, 1, nil, nil]
|
23
23
|
})
|
24
24
|
}
|
25
25
|
|
@@ -69,5 +69,13 @@ describe Coveralls::SimpleCov::Formatter do
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
+
context "#get_source_files" do
|
73
|
+
let(:source_files) { Coveralls::SimpleCov::Formatter.new.get_source_files(result) }
|
74
|
+
it "nils the skipped lines" do
|
75
|
+
source_file = source_files.first
|
76
|
+
source_file[:coverage].should_not eq result.files.first.coverage
|
77
|
+
source_file[:coverage].should eq [nil, 1, 1, 1, nil, 0, 1, nil, nil, nil]
|
78
|
+
end
|
79
|
+
end
|
72
80
|
end
|
73
81
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coveralls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Merwin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-10
|
12
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|