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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a846818377296cbdc1e2e3a02e95b78bda07a89e
4
- data.tar.gz: 85ef772d52ce6d32237249a2dbeffae914973409
3
+ metadata.gz: 766530ea38e74bb4d1a38671945a41f572aa063b
4
+ data.tar.gz: 51352ecb98eb89ba741000a4efd3accb9c946f23
5
5
  SHA512:
6
- metadata.gz: e16b49628b4e0bcff035e460129dc1825b065faa01eda452707470034e36d07f805a9a6b56ba0ec7875a6198f79e8732041681349907ac2a77211c23dc2f2981
7
- data.tar.gz: 0cb60c9f52e2fd31b1ed4bcf8e22dbc3b09cbf1a4e6850c93ba558c88e560a479a39e1e7348a7d0bc0bfed984c543dbad5278f1ece66984965c50bc55c666ea4
6
+ metadata.gz: b41e904e1aca79f3179b8aaf45fbcc7ac501e11a414819f6034031cf6aef57c8738958b9f5d30b9e1980d1f06c434864792651ca8806c6d0c813ff392af4fcb6
7
+ data.tar.gz: 0012c11f145c1309224430ca2263d78b6b2c58f7ad2b8415356b1c9f9fb1cb66ec8624411e295b49f0209cb00161b2c6beb154fe82df6718970ab7c11af8fb05
data/Gemfile CHANGED
@@ -24,3 +24,7 @@ platform :rbx do
24
24
  gem 'json'
25
25
  gem 'rubinius-developer_tools'
26
26
  end
27
+
28
+ group :test do
29
+ gem 'pry'
30
+ end
@@ -26,15 +26,7 @@ module Coveralls
26
26
  true
27
27
  end
28
28
 
29
- def format(result)
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
- # Get the group
53
- # puts "result groups: #{result.groups}"
54
- # result.groups.each do |group_name, grouped_files|
55
- # puts "Checking #{grouped_files.map(&:filename)} for #{file.filename}"
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
- # Log which files are being submitted.
66
- # puts "Submitting #{source_files.length} file#{source_files.length == 1 ? '' : 's'}:"
67
- # source_files.each do |f|
68
- # puts " => #{f[:name]}"
69
- # end
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", {:source_files => source_files, :test_framework => result.command_name.downcase, :run_at => result.created_at}
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
@@ -1,3 +1,3 @@
1
1
  module Coveralls
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.5"
3
3
  end
@@ -3,8 +3,10 @@ class Foo
3
3
  def initialize
4
4
  @foo = 'baz'
5
5
  end
6
-
6
+
7
+ # :nocov:
7
8
  def bar
8
9
  @foo
9
10
  end
10
- end
11
+ # :nocov:
12
+ end
@@ -4,7 +4,9 @@ class Foo
4
4
  @foo = 'baz'
5
5
  end
6
6
 
7
+ # :nocov:
7
8
  def bar
8
9
  @foo
9
10
  end
11
+ # :nocov:
10
12
  end
@@ -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, nil, 0, 0, nil, 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
@@ -2,6 +2,8 @@ require 'simplecov'
2
2
  require 'webmock'
3
3
  require 'vcr'
4
4
 
5
+ require 'pry' if RUBY_VERSION > "1.8.7"
6
+
5
7
  class InceptionFormatter
6
8
  def format(result)
7
9
  Coveralls::SimpleCov::Formatter.new.format(result)
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.3
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-02 00:00:00.000000000 Z
12
+ date: 2015-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json