simplecov 0.11.1 → 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 +16 -2
- data/.travis.yml +9 -4
- data/CHANGELOG.md +36 -2
- data/Gemfile +17 -13
- data/README.md +3 -23
- 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 +14 -10
- data/lib/simplecov/defaults.rb +14 -11
- data/lib/simplecov/filter.rb +1 -1
- data/lib/simplecov/jruby_fix.rb +1 -1
- data/lib/simplecov/merge_helpers.rb +11 -12
- data/lib/simplecov/profiles.rb +2 -2
- data/lib/simplecov/result.rb +8 -2
- data/lib/simplecov/source_file.rb +18 -14
- data/lib/simplecov/version.rb +9 -6
- data/lib/simplecov.rb +27 -14
- 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 +12 -84
data/lib/simplecov.rb
CHANGED
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
# Code coverage for ruby 1.9. Please check out README for a full introduction.
|
|
3
3
|
#
|
|
4
4
|
# Coverage may be inaccurate under JRUBY.
|
|
5
|
-
if defined?(JRUBY_VERSION)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
if defined?(JRUBY_VERSION) && defined?(JRuby)
|
|
6
|
+
|
|
7
|
+
# @see https://github.com/jruby/jruby/issues/1196
|
|
8
|
+
# @see https://github.com/metricfu/metric_fu/pull/226
|
|
9
|
+
# @see https://github.com/colszowka/simplecov/issues/420
|
|
10
|
+
# @see https://github.com/colszowka/simplecov/issues/86
|
|
11
|
+
# @see https://jira.codehaus.org/browse/JRUBY-6106
|
|
12
|
+
|
|
13
|
+
unless org.jruby.RubyInstanceConfig.FULL_TRACE_ENABLED
|
|
14
|
+
warn 'Coverage may be inaccurate; set the "--debug" command line option,' \
|
|
15
|
+
' or do JRUBY_OPTS="--debug"' \
|
|
16
|
+
' or set the "debug.fullTrace=true" option in your .jrubyrc'
|
|
12
17
|
end
|
|
13
18
|
end
|
|
14
19
|
module SimpleCov
|
|
@@ -53,9 +58,9 @@ module SimpleCov
|
|
|
53
58
|
# their coverage to zero.
|
|
54
59
|
#
|
|
55
60
|
def add_not_loaded_files(result)
|
|
56
|
-
if
|
|
61
|
+
if track_files
|
|
57
62
|
result = result.dup
|
|
58
|
-
Dir[
|
|
63
|
+
Dir[track_files].each do |file|
|
|
59
64
|
absolute = File.expand_path(file)
|
|
60
65
|
|
|
61
66
|
result[absolute] ||= [0] * File.foreach(absolute).count
|
|
@@ -70,14 +75,22 @@ module SimpleCov
|
|
|
70
75
|
# from cache using SimpleCov::ResultMerger if use_merging is activated (default)
|
|
71
76
|
#
|
|
72
77
|
def result
|
|
73
|
-
|
|
78
|
+
# Ensure the variable is defined to avoid ruby warnings
|
|
79
|
+
@result = nil unless defined?(@result)
|
|
80
|
+
|
|
81
|
+
# Collect our coverage result
|
|
82
|
+
if running && !result?
|
|
83
|
+
@result = SimpleCov::Result.new add_not_loaded_files(Coverage.result)
|
|
84
|
+
end
|
|
85
|
+
|
|
74
86
|
# If we're using merging of results, store the current result
|
|
75
87
|
# first, then merge the results and return those
|
|
76
88
|
if use_merging
|
|
77
|
-
SimpleCov::ResultMerger.store_result(@result) if
|
|
78
|
-
|
|
89
|
+
SimpleCov::ResultMerger.store_result(@result) if result?
|
|
90
|
+
|
|
91
|
+
SimpleCov::ResultMerger.merged_result
|
|
79
92
|
else
|
|
80
|
-
|
|
93
|
+
@result
|
|
81
94
|
end
|
|
82
95
|
ensure
|
|
83
96
|
self.running = false
|
|
@@ -112,7 +125,7 @@ module SimpleCov
|
|
|
112
125
|
grouped[name] = SimpleCov::FileList.new(files.select { |source_file| filter.matches?(source_file) })
|
|
113
126
|
grouped_files += grouped[name]
|
|
114
127
|
end
|
|
115
|
-
if groups.
|
|
128
|
+
if !groups.empty? && !(other_files = files.reject { |source_file| grouped_files.include?(source_file) }).empty?
|
|
116
129
|
grouped["Ungrouped"] = SimpleCov::FileList.new(other_files)
|
|
117
130
|
end
|
|
118
131
|
grouped
|
data/simplecov.gemspec
CHANGED
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
|
14
14
|
|
|
15
15
|
gem.required_ruby_version = ">= 1.8.7"
|
|
16
16
|
|
|
17
|
-
gem.add_dependency "json", "
|
|
17
|
+
gem.add_dependency "json", ">= 1.8", "< 3"
|
|
18
18
|
gem.add_dependency "simplecov-html", "~> 0.10.0"
|
|
19
19
|
gem.add_dependency "docile", "~> 1.1.0"
|
|
20
20
|
|
data/spec/1_8_fallbacks_spec.rb
CHANGED
|
@@ -6,24 +6,26 @@ require "helper"
|
|
|
6
6
|
# TODO: This should be expanded upon all methods that could potentially
|
|
7
7
|
# be called in a test/spec-helper simplecov config block
|
|
8
8
|
#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
if RUBY_VERSION.start_with? "1.8"
|
|
10
|
+
describe "Ruby 1.8 fallback" do
|
|
11
|
+
it "return false when calling SimpleCov.start" do
|
|
12
|
+
expect(SimpleCov.start).to be false
|
|
13
|
+
end
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
it "return false when calling SimpleCov.start with a block" do
|
|
16
|
+
expect(SimpleCov.start { raise "Shouldn't reach this!" }).to be false
|
|
17
|
+
end
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
it "return false when calling SimpleCov.configure with a block" do
|
|
20
|
+
expect(SimpleCov.configure { raise "Shouldn't reach this!" }).to be false
|
|
21
|
+
end
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
it "allow to define a profile" do
|
|
24
|
+
expect do
|
|
25
|
+
SimpleCov.profiles.define "testprofile" do
|
|
26
|
+
add_filter "/config/"
|
|
27
|
+
end
|
|
28
|
+
end.not_to raise_error
|
|
29
|
+
end
|
|
28
30
|
end
|
|
29
|
-
end
|
|
31
|
+
end
|
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
require "helper"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
if SimpleCov.usable?
|
|
4
|
+
describe SimpleCov::CommandGuesser do
|
|
5
|
+
subject { SimpleCov::CommandGuesser }
|
|
6
|
+
it 'correctly guesses "Unit Tests" for unit tests' do
|
|
7
|
+
subject.original_run_command = "/some/path/test/units/foo_bar_test.rb"
|
|
8
|
+
expect(subject.guess).to eq("Unit Tests")
|
|
9
|
+
subject.original_run_command = "test/units/foo.rb"
|
|
10
|
+
expect(subject.guess).to eq("Unit Tests")
|
|
11
|
+
subject.original_run_command = "test/foo.rb"
|
|
12
|
+
expect(subject.guess).to eq("Unit Tests")
|
|
13
|
+
subject.original_run_command = "test/{models,helpers,unit}/**/*_test.rb"
|
|
14
|
+
expect(subject.guess).to eq("Unit Tests")
|
|
15
|
+
end
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
it 'correctly guesses "Functional Tests" for functional tests' do
|
|
18
|
+
subject.original_run_command = "/some/path/test/functional/foo_bar_controller_test.rb"
|
|
19
|
+
expect(subject.guess).to eq("Functional Tests")
|
|
20
|
+
subject.original_run_command = "test/{controllers,mailers,functional}/**/*_test.rb"
|
|
21
|
+
expect(subject.guess).to eq("Functional Tests")
|
|
22
|
+
end
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
it 'correctly guesses "Integration Tests" for integration tests' do
|
|
25
|
+
subject.original_run_command = "/some/path/test/integration/foo_bar_controller_test.rb"
|
|
26
|
+
expect(subject.guess).to eq("Integration Tests")
|
|
27
|
+
subject.original_run_command = "test/integration/**/*_test.rb"
|
|
28
|
+
expect(subject.guess).to eq("Integration Tests")
|
|
29
|
+
end
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
it 'correctly guesses "Cucumber Features" for cucumber features' do
|
|
32
|
+
subject.original_run_command = "features"
|
|
33
|
+
expect(subject.guess).to eq("Cucumber Features")
|
|
34
|
+
subject.original_run_command = "cucumber"
|
|
35
|
+
expect(subject.guess).to eq("Cucumber Features")
|
|
36
|
+
end
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
it 'correctly guesses "RSpec" for RSpec' do
|
|
39
|
+
subject.original_run_command = "/some/path/spec/foo.rb"
|
|
40
|
+
expect(subject.guess).to eq("RSpec")
|
|
41
|
+
end
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
it "defaults to RSpec because RSpec constant is defined" do
|
|
44
|
+
subject.original_run_command = "some_arbitrary_command with arguments"
|
|
45
|
+
expect(subject.guess).to eq("RSpec")
|
|
46
|
+
end
|
|
45
47
|
end
|
|
46
|
-
end
|
|
48
|
+
end
|
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
|