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.
- checksums.yaml +4 -4
- data/.rubocop.yml +11 -0
- data/.travis.yml +9 -4
- data/CHANGELOG.md +21 -1
- data/Gemfile +17 -13
- data/README.md +3 -16
- data/Rakefile +9 -4
- data/features/step_definitions/simplecov_steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/lib/simplecov/configuration.rb +4 -4
- data/lib/simplecov/defaults.rb +1 -1
- data/lib/simplecov/filter.rb +1 -1
- data/lib/simplecov/merge_helpers.rb +11 -9
- data/lib/simplecov/profiles.rb +2 -2
- data/lib/simplecov/result.rb +6 -1
- data/lib/simplecov/source_file.rb +11 -7
- data/lib/simplecov/version.rb +2 -2
- data/lib/simplecov.rb +5 -4
- data/simplecov.gemspec +1 -1
- data/spec/1_8_fallbacks_spec.rb +19 -17
- data/spec/command_guesser_spec.rb +40 -38
- data/spec/faked_project/lib/faked_project/some_class.rb +1 -1
- data/spec/faked_project/spec/forking_spec.rb +2 -1
- data/spec/file_list_spec.rb +48 -46
- data/spec/filters_spec.rb +73 -71
- data/spec/fixtures/deleted_source_sample.rb +1 -1
- data/spec/merge_helpers_spec.rb +96 -78
- data/spec/result_spec.rb +152 -150
- data/spec/return_codes_spec.rb +5 -8
- data/spec/source_file_line_spec.rb +109 -107
- data/spec/source_file_spec.rb +56 -54
- metadata +11 -5
data/spec/file_list_spec.rb
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
1
|
require "helper"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
end
|
|
3
|
+
if SimpleCov.usable?
|
|
4
|
+
describe SimpleCov::Result do
|
|
5
|
+
subject do
|
|
6
|
+
original_result = {
|
|
7
|
+
source_fixture("sample.rb") => [nil, 1, 1, 1, nil, nil, 1, 1, nil, nil],
|
|
8
|
+
source_fixture("app/models/user.rb") => [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil],
|
|
9
|
+
source_fixture("app/controllers/sample_controller.rb") => [nil, 2, 2, 0, nil, nil, 0, nil, nil, nil],
|
|
10
|
+
}
|
|
11
|
+
SimpleCov::Result.new(original_result).files
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "has 11 covered lines" do
|
|
15
|
+
expect(subject.covered_lines).to eq(11)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "has 3 missed lines" do
|
|
19
|
+
expect(subject.missed_lines).to eq(3)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "has 19 never lines" do
|
|
23
|
+
expect(subject.never_lines).to eq(19)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "has 14 lines of code" do
|
|
27
|
+
expect(subject.lines_of_code).to eq(14)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "has 3 skipped lines" do
|
|
31
|
+
expect(subject.skipped_lines).to eq(3)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "has the correct covered percent" do
|
|
35
|
+
expect(subject.covered_percent).to eq(78.57142857142857)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it "has the correct covered percentages" do
|
|
39
|
+
expect(subject.covered_percentages).to eq([50.0, 80.0, 100.0])
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
it "has the correct least covered file" do
|
|
43
|
+
expect(subject.least_covered_file).to match(/sample_controller.rb/)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "has the correct covered strength" do
|
|
47
|
+
expect(subject.covered_strength).to eq(0.9285714285714286)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
data/spec/filters_spec.rb
CHANGED
|
@@ -1,96 +1,98 @@
|
|
|
1
1
|
require "helper"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
it "doesn't match a new SimpleCov::StringFilter 'foobar'" do
|
|
9
|
-
expect(SimpleCov::StringFilter.new("foobar")).not_to be_matches subject
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
it "doesn't match a new SimpleCov::StringFilter 'some/path'" do
|
|
13
|
-
expect(SimpleCov::StringFilter.new("some/path")).not_to be_matches subject
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it "matches a new SimpleCov::StringFilter 'spec/fixtures'" do
|
|
17
|
-
expect(SimpleCov::StringFilter.new("spec/fixtures")).to be_matches subject
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
it "matches a new SimpleCov::StringFilter 'spec/fixtures/sample.rb'" do
|
|
21
|
-
expect(SimpleCov::StringFilter.new("spec/fixtures/sample.rb")).to be_matches subject
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it "matches a new SimpleCov::StringFilter 'sample.rb'" do
|
|
25
|
-
expect(SimpleCov::StringFilter.new("sample.rb")).to be_matches subject
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it "doesn't match a new SimpleCov::BlockFilter that is not applicable" do
|
|
29
|
-
expect(SimpleCov::BlockFilter.new(proc { |s| File.basename(s.filename) == "foo.rb" })).not_to be_matches subject
|
|
30
|
-
end
|
|
3
|
+
if SimpleCov.usable?
|
|
4
|
+
describe SimpleCov::SourceFile do
|
|
5
|
+
subject do
|
|
6
|
+
SimpleCov::SourceFile.new(source_fixture("sample.rb"), [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil])
|
|
7
|
+
end
|
|
31
8
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
9
|
+
it "doesn't match a new SimpleCov::StringFilter 'foobar'" do
|
|
10
|
+
expect(SimpleCov::StringFilter.new("foobar")).not_to be_matches subject
|
|
11
|
+
end
|
|
35
12
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
13
|
+
it "doesn't match a new SimpleCov::StringFilter 'some/path'" do
|
|
14
|
+
expect(SimpleCov::StringFilter.new("some/path")).not_to be_matches subject
|
|
15
|
+
end
|
|
39
16
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
17
|
+
it "matches a new SimpleCov::StringFilter 'spec/fixtures'" do
|
|
18
|
+
expect(SimpleCov::StringFilter.new("spec/fixtures")).to be_matches subject
|
|
19
|
+
end
|
|
43
20
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
21
|
+
it "matches a new SimpleCov::StringFilter 'spec/fixtures/sample.rb'" do
|
|
22
|
+
expect(SimpleCov::StringFilter.new("spec/fixtures/sample.rb")).to be_matches subject
|
|
23
|
+
end
|
|
47
24
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@prev_filters = SimpleCov.filters
|
|
51
|
-
SimpleCov.filters = []
|
|
25
|
+
it "matches a new SimpleCov::StringFilter 'sample.rb'" do
|
|
26
|
+
expect(SimpleCov::StringFilter.new("sample.rb")).to be_matches subject
|
|
52
27
|
end
|
|
53
28
|
|
|
54
|
-
|
|
55
|
-
|
|
29
|
+
it "doesn't match a new SimpleCov::BlockFilter that is not applicable" do
|
|
30
|
+
expect(SimpleCov::BlockFilter.new(proc { |s| File.basename(s.filename) == "foo.rb" })).not_to be_matches subject
|
|
56
31
|
end
|
|
57
32
|
|
|
58
|
-
|
|
59
|
-
SimpleCov.
|
|
33
|
+
it "matches a new SimpleCov::BlockFilter that is applicable" do
|
|
34
|
+
expect(SimpleCov::BlockFilter.new(proc { |s| File.basename(s.filename) == "sample.rb" })).to be_matches subject
|
|
60
35
|
end
|
|
61
36
|
|
|
62
|
-
it
|
|
63
|
-
SimpleCov.
|
|
64
|
-
expect(SimpleCov.filtered(subject).count).to be_zero
|
|
37
|
+
it "matches a new SimpleCov::ArrayFilter when 'sample.rb' is passed as array" do
|
|
38
|
+
expect(SimpleCov::ArrayFilter.new(["sample.rb"])).to be_matches subject
|
|
65
39
|
end
|
|
66
40
|
|
|
67
|
-
it '
|
|
68
|
-
SimpleCov.
|
|
69
|
-
expect(SimpleCov.filtered(subject).count).to be_zero
|
|
41
|
+
it "doesn't match a new SimpleCov::ArrayFilter when a file path different than 'sample.rb' is passed as array" do
|
|
42
|
+
expect(SimpleCov::ArrayFilter.new(["other_file.rb"])).not_to be_matches subject
|
|
70
43
|
end
|
|
71
44
|
|
|
72
|
-
it
|
|
73
|
-
SimpleCov.
|
|
74
|
-
expect(SimpleCov.filtered(subject).count).to eq(1)
|
|
45
|
+
it "matches a new SimpleCov::ArrayFilter when two file paths including 'sample.rb' are passed as array" do
|
|
46
|
+
expect(SimpleCov::ArrayFilter.new(["sample.rb", "other_file.rb"])).to be_matches subject
|
|
75
47
|
end
|
|
76
48
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
49
|
+
context "with no filters set up and a basic source file in an array" do
|
|
50
|
+
before do
|
|
51
|
+
@prev_filters = SimpleCov.filters
|
|
52
|
+
SimpleCov.filters = []
|
|
80
53
|
end
|
|
81
|
-
expect(SimpleCov.filtered(subject).count).to be_zero
|
|
82
|
-
end
|
|
83
54
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
55
|
+
subject do
|
|
56
|
+
[SimpleCov::SourceFile.new(source_fixture("sample.rb"), [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil])]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
after do
|
|
60
|
+
SimpleCov.filters = @prev_filters
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
it 'returns 0 items after executing SimpleCov.filtered on files when using a "sample" string filter' do
|
|
64
|
+
SimpleCov.add_filter "sample"
|
|
65
|
+
expect(SimpleCov.filtered(subject).count).to be_zero
|
|
87
66
|
end
|
|
88
|
-
expect(SimpleCov.filtered(subject).count).to eq(1)
|
|
89
|
-
end
|
|
90
67
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
68
|
+
it 'returns 0 items after executing SimpleCov.filtered on files when using a "spec/fixtures" string filter' do
|
|
69
|
+
SimpleCov.add_filter "spec/fixtures"
|
|
70
|
+
expect(SimpleCov.filtered(subject).count).to be_zero
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
it 'returns 1 item after executing SimpleCov.filtered on files when using a "fooo" string filter' do
|
|
74
|
+
SimpleCov.add_filter "fooo"
|
|
75
|
+
expect(SimpleCov.filtered(subject).count).to eq(1)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
it "returns 0 items after executing SimpleCov.filtered on files when using a block filter that returns true" do
|
|
79
|
+
SimpleCov.add_filter do
|
|
80
|
+
true
|
|
81
|
+
end
|
|
82
|
+
expect(SimpleCov.filtered(subject).count).to be_zero
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it "returns 1 item after executing SimpleCov.filtered on files when using an always-false block filter" do
|
|
86
|
+
SimpleCov.add_filter do
|
|
87
|
+
false
|
|
88
|
+
end
|
|
89
|
+
expect(SimpleCov.filtered(subject).count).to eq(1)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
it "returns a FileList after filtering" do
|
|
93
|
+
SimpleCov.add_filter "fooo"
|
|
94
|
+
expect(SimpleCov.filtered(subject)).to be_a SimpleCov::FileList
|
|
95
|
+
end
|
|
94
96
|
end
|
|
95
97
|
end
|
|
96
|
-
end
|
|
98
|
+
end
|
data/spec/merge_helpers_spec.rb
CHANGED
|
@@ -1,108 +1,126 @@
|
|
|
1
1
|
require "helper"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
describe "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
it "has proper results for sample.rb" do
|
|
28
|
-
expect(subject[source_fixture("sample.rb")]).to eq([1, 1, 2, 2, nil, nil, 2, 2, nil, nil])
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it "has proper results for user.rb" do
|
|
32
|
-
expect(subject[source_fixture("app/models/user.rb")]).to eq([nil, 2, 6, 2, nil, nil, 2, 0, nil, nil])
|
|
3
|
+
if SimpleCov.usable?
|
|
4
|
+
describe "merge helpers" do
|
|
5
|
+
describe "with two faked coverage resultsets" do
|
|
6
|
+
before do
|
|
7
|
+
SimpleCov.use_merging true
|
|
8
|
+
@resultset1 = {
|
|
9
|
+
source_fixture("sample.rb") => [nil, 1, 1, 1, nil, nil, 1, 1, nil, nil],
|
|
10
|
+
source_fixture("app/models/user.rb") => [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil],
|
|
11
|
+
source_fixture("app/controllers/sample_controller.rb") => [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil],
|
|
12
|
+
source_fixture("resultset1.rb") => [1, 1, 1, 1],
|
|
13
|
+
source_fixture("parallel_tests.rb") => [nil, 0, nil, 0],
|
|
14
|
+
source_fixture("conditionally_loaded_1.rb") => [nil, 0, 1], # loaded only in the first resultset
|
|
15
|
+
}.extend(SimpleCov::HashMergeHelper)
|
|
16
|
+
|
|
17
|
+
@resultset2 = {
|
|
18
|
+
source_fixture("sample.rb") => [1, nil, 1, 1, nil, nil, 1, 1, nil, nil],
|
|
19
|
+
source_fixture("app/models/user.rb") => [nil, 1, 5, 1, nil, nil, 1, 0, nil, nil],
|
|
20
|
+
source_fixture("app/controllers/sample_controller.rb") => [nil, 3, 1, nil, nil, nil, 1, 0, nil, nil],
|
|
21
|
+
source_fixture("resultset2.rb") => [nil, 1, 1, nil],
|
|
22
|
+
source_fixture("parallel_tests.rb") => [nil, nil, 0, 0],
|
|
23
|
+
source_fixture("conditionally_loaded_2.rb") => [nil, 0, 1], # loaded only in the second resultset
|
|
24
|
+
}
|
|
33
25
|
end
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
context "a merge" do
|
|
28
|
+
subject do
|
|
29
|
+
@resultset1.merge_resultset(@resultset2)
|
|
30
|
+
end
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
it "has proper results for sample.rb" do
|
|
33
|
+
expect(subject[source_fixture("sample.rb")]).to eq([1, 1, 2, 2, nil, nil, 2, 2, nil, nil])
|
|
34
|
+
end
|
|
42
35
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
end
|
|
36
|
+
it "has proper results for user.rb" do
|
|
37
|
+
expect(subject[source_fixture("app/models/user.rb")]).to eq([nil, 2, 6, 2, nil, nil, 2, 0, nil, nil])
|
|
38
|
+
end
|
|
47
39
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
expect(SimpleCov::ResultMerger.resultset).to be_empty
|
|
52
|
-
end
|
|
40
|
+
it "has proper results for sample_controller.rb" do
|
|
41
|
+
expect(subject[source_fixture("app/controllers/sample_controller.rb")]).to eq([nil, 4, 2, 1, nil, nil, 2, 0, nil, nil])
|
|
42
|
+
end
|
|
53
43
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
expect(SimpleCov::ResultMerger.resultset).to be_empty
|
|
58
|
-
end
|
|
44
|
+
it "has proper results for resultset1.rb" do
|
|
45
|
+
expect(subject[source_fixture("resultset1.rb")]).to eq([1, 1, 1, 1])
|
|
46
|
+
end
|
|
59
47
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
@result1 = SimpleCov::Result.new(@resultset1)
|
|
64
|
-
@result1.command_name = "result1"
|
|
65
|
-
@result2 = SimpleCov::Result.new(@resultset2)
|
|
66
|
-
@result2.command_name = "result2"
|
|
67
|
-
end
|
|
48
|
+
it "has proper results for resultset2.rb" do
|
|
49
|
+
expect(subject[source_fixture("resultset2.rb")]).to eq([nil, 1, 1, nil])
|
|
50
|
+
end
|
|
68
51
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
SimpleCov::ResultMerger.store_result(@result1)
|
|
72
|
-
SimpleCov::ResultMerger.store_result(@result2)
|
|
52
|
+
it "has proper results for parallel_tests.rb" do
|
|
53
|
+
expect(subject[source_fixture("parallel_tests.rb")]).to eq([nil, nil, nil, 0])
|
|
73
54
|
end
|
|
74
55
|
|
|
75
|
-
it "has
|
|
76
|
-
expect(
|
|
56
|
+
it "has proper results for conditionally_loaded_1.rb" do
|
|
57
|
+
expect(subject[source_fixture("conditionally_loaded_1.rb")]).to eq([nil, 0, 1])
|
|
77
58
|
end
|
|
78
59
|
|
|
79
|
-
it "
|
|
80
|
-
expect(
|
|
60
|
+
it "has proper results for conditionally_loaded_2.rb" do
|
|
61
|
+
expect(subject[source_fixture("conditionally_loaded_2.rb")]).to eq([nil, 0, 1])
|
|
81
62
|
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# See Github issue #6
|
|
66
|
+
it "returns an empty hash when the resultset cache file is empty" do
|
|
67
|
+
File.open(SimpleCov::ResultMerger.resultset_path, "w+") { |f| f.puts "" }
|
|
68
|
+
expect(SimpleCov::ResultMerger.resultset).to be_empty
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# See Github issue #6
|
|
72
|
+
it "returns an empty hash when the resultset cache file is not present" do
|
|
73
|
+
system "rm #{SimpleCov::ResultMerger.resultset_path}" if File.exist?(SimpleCov::ResultMerger.resultset_path)
|
|
74
|
+
expect(SimpleCov::ResultMerger.resultset).to be_empty
|
|
75
|
+
end
|
|
82
76
|
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
context "and results generated from those" do
|
|
78
|
+
before do
|
|
79
|
+
system "rm #{SimpleCov::ResultMerger.resultset_path}" if File.exist?(SimpleCov::ResultMerger.resultset_path)
|
|
80
|
+
@result1 = SimpleCov::Result.new(@resultset1)
|
|
81
|
+
@result1.command_name = "result1"
|
|
82
|
+
@result2 = SimpleCov::Result.new(@resultset2)
|
|
83
|
+
@result2.command_name = "result2"
|
|
85
84
|
end
|
|
86
85
|
|
|
87
|
-
context "with
|
|
86
|
+
context "with stored results" do
|
|
88
87
|
before do
|
|
89
|
-
@
|
|
88
|
+
SimpleCov::ResultMerger.store_result(@result1)
|
|
90
89
|
SimpleCov::ResultMerger.store_result(@result2)
|
|
91
90
|
end
|
|
92
91
|
|
|
93
|
-
it "has
|
|
94
|
-
expect(SimpleCov::ResultMerger.
|
|
92
|
+
it "has stored data in resultset_path JSON file" do
|
|
93
|
+
expect(File.readlines(SimpleCov::ResultMerger.resultset_path).length).to be > 50
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
it "returns a hash containing keys ['result1' and 'result2'] for resultset" do
|
|
97
|
+
expect(SimpleCov::ResultMerger.resultset.keys.sort).to eq %w(result1 result2)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
it "returns proper values for merged_result" do
|
|
101
|
+
expect(SimpleCov::ResultMerger.merged_result.source_files.find { |s| s.filename =~ /user/ }.lines.map(&:coverage)).to eq([nil, 2, 6, 2, nil, nil, 2, 0, nil, nil])
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
context "with second result way above the merge_timeout" do
|
|
105
|
+
before do
|
|
106
|
+
@result2.created_at = Time.now - 172_800 # two days ago
|
|
107
|
+
SimpleCov::ResultMerger.store_result(@result2)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
it "has only one result in SimpleCov::ResultMerger.results" do
|
|
111
|
+
expect(SimpleCov::ResultMerger.results.length).to eq(1)
|
|
112
|
+
end
|
|
95
113
|
end
|
|
96
|
-
end
|
|
97
114
|
|
|
98
|
-
|
|
99
|
-
|
|
115
|
+
context "with merging disabled" do
|
|
116
|
+
before { SimpleCov.use_merging false }
|
|
100
117
|
|
|
101
|
-
|
|
102
|
-
|
|
118
|
+
it "returns nil for SimpleCov.result" do
|
|
119
|
+
expect(SimpleCov.result).to be_nil
|
|
120
|
+
end
|
|
103
121
|
end
|
|
104
122
|
end
|
|
105
123
|
end
|
|
106
124
|
end
|
|
107
125
|
end
|
|
108
|
-
end
|
|
126
|
+
end
|