simplecov 0.11.2 → 0.13.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.
@@ -1,75 +1,77 @@
1
1
  require "helper"
2
2
 
3
- describe SimpleCov::SourceFile do
4
- COVERAGE_FOR_SAMPLE_RB = [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil, nil, nil, nil, nil, nil, nil].freeze
5
- context "a source file initialized with some coverage data" do
6
- subject do
7
- SimpleCov::SourceFile.new(source_fixture("sample.rb"), COVERAGE_FOR_SAMPLE_RB)
8
- end
9
-
10
- it "has a filename" do
11
- expect(subject.filename).not_to be_nil
12
- end
3
+ if SimpleCov.usable?
4
+ describe SimpleCov::SourceFile do
5
+ COVERAGE_FOR_SAMPLE_RB = [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil, nil, nil, nil, nil, nil, nil].freeze
6
+ context "a source file initialized with some coverage data" do
7
+ subject do
8
+ SimpleCov::SourceFile.new(source_fixture("sample.rb"), COVERAGE_FOR_SAMPLE_RB)
9
+ end
13
10
 
14
- it "has source equal to src" do
15
- expect(subject.src).to eq(subject.source)
16
- end
11
+ it "has a filename" do
12
+ expect(subject.filename).not_to be_nil
13
+ end
17
14
 
18
- it "has source_lines equal to lines" do
19
- expect(subject.lines).to eq(subject.source_lines)
20
- end
15
+ it "has source equal to src" do
16
+ expect(subject.src).to eq(subject.source)
17
+ end
21
18
 
22
- it "has 16 source lines" do
23
- expect(subject.lines.count).to eq(16)
24
- end
19
+ it "has source_lines equal to lines" do
20
+ expect(subject.lines).to eq(subject.source_lines)
21
+ end
25
22
 
26
- it "has all source lines of type SimpleCov::SourceFile::Line" do
27
- subject.lines.each do |line|
28
- expect(line).to be_a SimpleCov::SourceFile::Line
23
+ it "has 16 source lines" do
24
+ expect(subject.lines.count).to eq(16)
29
25
  end
30
- end
31
26
 
32
- it "has 'class Foo' as line(2).source" do
33
- expect(subject.line(2).source).to eq("class Foo\n")
34
- end
27
+ it "has all source lines of type SimpleCov::SourceFile::Line" do
28
+ subject.lines.each do |line|
29
+ expect(line).to be_a SimpleCov::SourceFile::Line
30
+ end
31
+ end
35
32
 
36
- it "returns lines number 2, 3, 4, 7 for covered_lines" do
37
- expect(subject.covered_lines.map(&:line)).to eq([2, 3, 4, 7])
38
- end
33
+ it "has 'class Foo' as line(2).source" do
34
+ expect(subject.line(2).source).to eq("class Foo\n")
35
+ end
39
36
 
40
- it "returns lines number 8 for missed_lines" do
41
- expect(subject.missed_lines.map(&:line)).to eq([8])
42
- end
37
+ it "returns lines number 2, 3, 4, 7 for covered_lines" do
38
+ expect(subject.covered_lines.map(&:line)).to eq([2, 3, 4, 7])
39
+ end
43
40
 
44
- it "returns lines number 1, 5, 6, 9, 10, 11, 15, 16 for never_lines" do
45
- expect(subject.never_lines.map(&:line)).to eq([1, 5, 6, 9, 10, 11, 15, 16])
46
- end
41
+ it "returns lines number 8 for missed_lines" do
42
+ expect(subject.missed_lines.map(&:line)).to eq([8])
43
+ end
47
44
 
48
- it "returns line numbers 12, 13, 14 for skipped_lines" do
49
- expect(subject.skipped_lines.map(&:line)).to eq([12, 13, 14])
50
- end
45
+ it "returns lines number 1, 5, 6, 9, 10, 11, 15, 16 for never_lines" do
46
+ expect(subject.never_lines.map(&:line)).to eq([1, 5, 6, 9, 10, 11, 15, 16])
47
+ end
51
48
 
52
- it "has 80% covered_percent" do
53
- expect(subject.covered_percent).to eq(80.0)
54
- end
55
- end
49
+ it "returns line numbers 12, 13, 14 for skipped_lines" do
50
+ expect(subject.skipped_lines.map(&:line)).to eq([12, 13, 14])
51
+ end
56
52
 
57
- context "simulating potential Ruby 1.9 defect -- see Issue #56" do
58
- subject do
59
- SimpleCov::SourceFile.new(source_fixture("sample.rb"), COVERAGE_FOR_SAMPLE_RB + [nil])
53
+ it "has 80% covered_percent" do
54
+ expect(subject.covered_percent).to eq(80.0)
55
+ end
60
56
  end
61
57
 
62
- it "has 16 source lines regardless of extra data in coverage array" do
63
- # Do not litter test output with known warning
64
- capture_stderr { expect(subject.lines.count).to eq(16) }
65
- end
58
+ context "simulating potential Ruby 1.9 defect -- see Issue #56" do
59
+ subject do
60
+ SimpleCov::SourceFile.new(source_fixture("sample.rb"), COVERAGE_FOR_SAMPLE_RB + [nil])
61
+ end
66
62
 
67
- it "prints a warning to stderr if coverage array contains more data than lines in the file" do
68
- captured_output = capture_stderr do
69
- subject.lines
63
+ it "has 16 source lines regardless of extra data in coverage array" do
64
+ # Do not litter test output with known warning
65
+ capture_stderr { expect(subject.lines.count).to eq(16) }
70
66
  end
71
67
 
72
- expect(captured_output).to match(/^Warning: coverage data provided/)
68
+ it "prints a warning to stderr if coverage array contains more data than lines in the file" do
69
+ captured_output = capture_stderr do
70
+ subject.lines
71
+ end
72
+
73
+ expect(captured_output).to match(/^Warning: coverage data provided/)
74
+ end
73
75
  end
74
76
  end
75
- end if SimpleCov.usable?
77
+ end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Olszowka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-03 00:00:00.000000000 Z
11
+ date: 2017-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.8'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.8'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: simplecov-html
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -209,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
215
  version: '0'
210
216
  requirements: []
211
217
  rubyforge_project:
212
- rubygems_version: 2.5.1
218
+ rubygems_version: 2.6.10
213
219
  signing_key:
214
220
  specification_version: 4
215
221
  summary: Code coverage for Ruby 1.9+ with a powerful configuration library and automatic