simplecov 0.13.0 → 0.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +99 -3
  3. data/CONTRIBUTING.md +12 -9
  4. data/ISSUE_TEMPLATE.md +23 -0
  5. data/{MIT-LICENSE → LICENSE} +1 -1
  6. data/README.md +90 -43
  7. data/doc/alternate-formatters.md +21 -1
  8. data/doc/editor-integration.md +6 -1
  9. data/lib/simplecov.rb +131 -13
  10. data/lib/simplecov/command_guesser.rb +2 -0
  11. data/lib/simplecov/configuration.rb +34 -25
  12. data/lib/simplecov/defaults.rb +12 -82
  13. data/lib/simplecov/exit_codes.rb +2 -0
  14. data/lib/simplecov/file_list.rb +7 -5
  15. data/lib/simplecov/filter.rb +41 -4
  16. data/lib/simplecov/formatter.rb +2 -0
  17. data/lib/simplecov/formatter/multi_formatter.rb +2 -0
  18. data/lib/simplecov/formatter/simple_formatter.rb +3 -1
  19. data/lib/simplecov/jruby_fix.rb +2 -0
  20. data/lib/simplecov/last_run.rb +5 -1
  21. data/lib/simplecov/lines_classifier.rb +48 -0
  22. data/lib/simplecov/load_global_config.rb +8 -0
  23. data/lib/simplecov/no_defaults.rb +2 -0
  24. data/lib/simplecov/profiles.rb +2 -0
  25. data/lib/simplecov/profiles/bundler_filter.rb +5 -0
  26. data/lib/simplecov/profiles/hidden_filter.rb +5 -0
  27. data/lib/simplecov/profiles/rails.rb +18 -0
  28. data/lib/simplecov/profiles/root_filter.rb +10 -0
  29. data/lib/simplecov/profiles/test_frameworks.rb +8 -0
  30. data/lib/simplecov/railtie.rb +2 -0
  31. data/lib/simplecov/railties/tasks.rake +2 -0
  32. data/lib/simplecov/raw_coverage.rb +41 -0
  33. data/lib/simplecov/result.rb +2 -1
  34. data/lib/simplecov/result_merger.rb +56 -21
  35. data/lib/simplecov/source_file.rb +43 -34
  36. data/lib/simplecov/version.rb +3 -23
  37. metadata +131 -99
  38. data/.gitignore +0 -31
  39. data/.rspec +0 -3
  40. data/.rubocop.yml +0 -84
  41. data/.travis.yml +0 -32
  42. data/.yardopts +0 -1
  43. data/Gemfile +0 -38
  44. data/Rakefile +0 -41
  45. data/cucumber.yml +0 -13
  46. data/features/config_autoload.feature +0 -46
  47. data/features/config_command_name.feature +0 -45
  48. data/features/config_coverage_dir.feature +0 -33
  49. data/features/config_deactivate_merging.feature +0 -42
  50. data/features/config_formatters.feature +0 -77
  51. data/features/config_merge_timeout.feature +0 -39
  52. data/features/config_nocov_token.feature +0 -79
  53. data/features/config_profiles.feature +0 -44
  54. data/features/config_project_name.feature +0 -27
  55. data/features/config_styles.feature +0 -121
  56. data/features/config_tracked_files.feature +0 -29
  57. data/features/cucumber_basic.feature +0 -29
  58. data/features/maximum_coverage_drop.feature +0 -36
  59. data/features/merging_test_unit_and_rspec.feature +0 -44
  60. data/features/minimum_coverage.feature +0 -59
  61. data/features/refuse_coverage_drop.feature +0 -35
  62. data/features/rspec_basic.feature +0 -32
  63. data/features/rspec_fails_on_initialization.feature +0 -14
  64. data/features/rspec_groups_and_filters_basic.feature +0 -29
  65. data/features/rspec_groups_and_filters_complex.feature +0 -37
  66. data/features/rspec_groups_using_filter_class.feature +0 -41
  67. data/features/rspec_without_simplecov.feature +0 -20
  68. data/features/skipping_code_blocks_manually.feature +0 -70
  69. data/features/step_definitions/html_steps.rb +0 -44
  70. data/features/step_definitions/simplecov_steps.rb +0 -68
  71. data/features/step_definitions/transformers.rb +0 -13
  72. data/features/step_definitions/web_steps.rb +0 -64
  73. data/features/support/env.rb +0 -50
  74. data/features/test_unit_basic.feature +0 -34
  75. data/features/test_unit_groups_and_filters_basic.feature +0 -29
  76. data/features/test_unit_groups_and_filters_complex.feature +0 -35
  77. data/features/test_unit_groups_using_filter_class.feature +0 -40
  78. data/features/test_unit_without_simplecov.feature +0 -20
  79. data/features/unicode_compatiblity.feature +0 -67
  80. data/lib/simplecov/merge_helpers.rb +0 -37
  81. data/simplecov.gemspec +0 -27
  82. data/spec/1_8_fallbacks_spec.rb +0 -31
  83. data/spec/command_guesser_spec.rb +0 -48
  84. data/spec/deleted_source_spec.rb +0 -12
  85. data/spec/faked_project/Gemfile +0 -6
  86. data/spec/faked_project/Rakefile +0 -8
  87. data/spec/faked_project/cucumber.yml +0 -13
  88. data/spec/faked_project/features/step_definitions/my_steps.rb +0 -22
  89. data/spec/faked_project/features/support/env.rb +0 -12
  90. data/spec/faked_project/features/test_stuff.feature +0 -6
  91. data/spec/faked_project/lib/faked_project.rb +0 -11
  92. data/spec/faked_project/lib/faked_project/framework_specific.rb +0 -18
  93. data/spec/faked_project/lib/faked_project/meta_magic.rb +0 -24
  94. data/spec/faked_project/lib/faked_project/some_class.rb +0 -28
  95. data/spec/faked_project/lib/faked_project/untested_class.rb +0 -11
  96. data/spec/faked_project/spec/faked_spec.rb +0 -11
  97. data/spec/faked_project/spec/forking_spec.rb +0 -8
  98. data/spec/faked_project/spec/meta_magic_spec.rb +0 -15
  99. data/spec/faked_project/spec/some_class_spec.rb +0 -13
  100. data/spec/faked_project/spec/spec_helper.rb +0 -11
  101. data/spec/faked_project/test/faked_test.rb +0 -11
  102. data/spec/faked_project/test/meta_magic_test.rb +0 -13
  103. data/spec/faked_project/test/some_class_test.rb +0 -15
  104. data/spec/faked_project/test/test_helper.rb +0 -12
  105. data/spec/file_list_spec.rb +0 -50
  106. data/spec/filters_spec.rb +0 -98
  107. data/spec/fixtures/app/controllers/sample_controller.rb +0 -10
  108. data/spec/fixtures/app/models/user.rb +0 -10
  109. data/spec/fixtures/deleted_source_sample.rb +0 -15
  110. data/spec/fixtures/frameworks/rspec_bad.rb +0 -9
  111. data/spec/fixtures/frameworks/rspec_good.rb +0 -9
  112. data/spec/fixtures/frameworks/testunit_bad.rb +0 -9
  113. data/spec/fixtures/frameworks/testunit_good.rb +0 -9
  114. data/spec/fixtures/iso-8859.rb +0 -3
  115. data/spec/fixtures/resultset1.rb +0 -4
  116. data/spec/fixtures/resultset2.rb +0 -4
  117. data/spec/fixtures/sample.rb +0 -16
  118. data/spec/fixtures/utf-8.rb +0 -3
  119. data/spec/helper.rb +0 -24
  120. data/spec/merge_helpers_spec.rb +0 -126
  121. data/spec/multi_formatter_spec.rb +0 -20
  122. data/spec/result_spec.rb +0 -209
  123. data/spec/return_codes_spec.rb +0 -34
  124. data/spec/source_file_line_spec.rb +0 -155
  125. data/spec/source_file_spec.rb +0 -77
@@ -1,48 +0,0 @@
1
- require "helper"
2
-
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
16
-
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
23
-
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
30
-
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
37
-
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
42
-
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
47
- end
48
- end
@@ -1,12 +0,0 @@
1
- require "helper"
2
-
3
- # Test to verify correct handling of deleted files
4
- # See https://github.com/colszowka/simplecov/issues/9
5
- describe "A source file which is subsequently deleted" do
6
- it "does not cause an error" do
7
- Dir.chdir(File.join(File.dirname(__FILE__), "fixtures")) do
8
- `ruby deleted_source_sample.rb`
9
- expect($?.exitstatus).to be_zero
10
- end
11
- end
12
- end
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "simplecov", :path => "../../../"
4
- gem "rake"
5
- gem "rspec", ">= 2.6.0"
6
- gem "cucumber"
@@ -1,8 +0,0 @@
1
- require "bundler"
2
-
3
- require "rake/testtask"
4
- Rake::TestTask.new(:test) do |test|
5
- test.libs << "lib" << "test"
6
- test.test_files = FileList["test/**/*_test.rb"].sort
7
- test.verbose = true
8
- end
@@ -1,13 +0,0 @@
1
- <%
2
- rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
- rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
- std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
5
- interp_opts = if defined?(RUBY_ENGINE)
6
- " --tags ~@exclude-#{RUBY_ENGINE}"
7
- else
8
- ''
9
- end
10
- %>
11
- default: <%= std_opts %><%= interp_opts %> features
12
- wip: --tags @wip:30 --wip features<%= interp_opts %>
13
- rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip<%= interp_opts %>
@@ -1,22 +0,0 @@
1
- Given /^I want to keep stuff simple$/ do
2
- expect(1).to eq(1)
3
- end
4
-
5
- When /^I write my cukes for the fake project$/ do
6
- expect(1).to eq(1)
7
- end
8
-
9
- Then /^I make all neccessary tests in a single step$/ do
10
- expect(FakedProject.foo).to eq("bar")
11
-
12
- expect(FrameworkSpecific.cucumber).to eq("Only tested in Cucumber")
13
-
14
- expect(FakedProject.a_class_method).to eq("this is a mixed-in class method")
15
-
16
- expect(FakedProject.new.an_instance_method).to eq("this is a mixed-in instance method")
17
- expect(FakedProject.new.dynamic).to eq("A dynamically defined instance method")
18
-
19
- something = SomeClass.new("foo")
20
- expect(something.reverse).to eq("oof")
21
- expect(something.compare_with("foo")).to be true
22
- end
@@ -1,12 +0,0 @@
1
- require "bundler/setup"
2
-
3
- # We're injecting simplecov_config via aruba in cucumber here
4
- # depending on what the test case is...
5
- begin
6
- require File.join(File.dirname(__FILE__), "simplecov_config")
7
- rescue LoadError
8
- $stderr.puts "No SimpleCov config file found!"
9
- end
10
-
11
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "/../../lib"))
12
- require "faked_project"
@@ -1,6 +0,0 @@
1
- Feature: Foo
2
-
3
- Scenario: Test stuff
4
- Given I want to keep stuff simple
5
- When I write my cukes for the fake project
6
- Then I make all neccessary tests in a single step
@@ -1,11 +0,0 @@
1
- class FakedProject
2
- def self.foo
3
- "bar"
4
- end
5
- end
6
-
7
- Dir[File.join(File.dirname(__FILE__), "faked_project/*.rb")].reject { |f| /untested/.match(f) }.each do |file|
8
- require file # Require all source files in project dynamically so we can inject some stuff depending on test situation
9
- end
10
-
11
- FakedProject.send :include, MetaMagic
@@ -1,18 +0,0 @@
1
- # A pile of methods that only get tested in their frameworks
2
- # and thus make this file only 100% covered when all framework test
3
- # results are merged
4
- module FrameworkSpecific
5
- class << self
6
- def cucumber
7
- "Only tested in Cucumber"
8
- end
9
-
10
- def rspec
11
- "Only tested in RSpec"
12
- end
13
-
14
- def test_unit
15
- "Only tested in Test/Unit"
16
- end
17
- end
18
- end
@@ -1,24 +0,0 @@
1
- module MetaMagic
2
- module ClassMethods
3
- def a_class_method
4
- "this is a mixed-in class method"
5
- end
6
- end
7
-
8
- module InstanceMethods
9
- def an_instance_method
10
- "this is a mixed-in instance method"
11
- end
12
- end
13
-
14
- def self.included(base)
15
- base.send :extend, ClassMethods
16
- base.send :include, InstanceMethods
17
-
18
- base.class_eval do
19
- define_method :dynamic do
20
- "A dynamically defined instance method"
21
- end
22
- end
23
- end
24
- end
@@ -1,28 +0,0 @@
1
- class SomeClass
2
- attr_reader :label
3
- attr_accessor :some_attr
4
-
5
- def initialize(label)
6
- @label = label
7
- end
8
-
9
- def reverse
10
- label.reverse
11
- end
12
-
13
- def compare_with(item)
14
- if item == label
15
- return true
16
- else
17
- raise "Item does not match label"
18
- end
19
- rescue
20
- false
21
- end
22
-
23
- private
24
-
25
- def uncovered
26
- "private method"
27
- end
28
- end
@@ -1,11 +0,0 @@
1
- class UntestedClass
2
- def initialize(yogurts)
3
- @yogurts = yogurts
4
- end
5
-
6
- def power_level
7
- @yogurts.map do |yo|
8
- yo.experience_points**2
9
- end.reduce(0, &:+)
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe FakedProject do
4
- it "should return proper foo" do
5
- expect(FakedProject.foo).to eq("bar")
6
- end
7
-
8
- it "should test it's framework specific method" do
9
- expect(FrameworkSpecific.rspec).to eq("Only tested in RSpec")
10
- end
11
- end
@@ -1,8 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "forking" do
4
- it do
5
- # TODO: The defined?(RUBY_ENGINE) check can be dropped for simplecov 1.0.0
6
- Process.waitpid(Kernel.fork {}) unless defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
7
- end
8
- end
@@ -1,15 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe FakedProject do
4
- it "should have added a class method to FakedProject" do
5
- expect(FakedProject.a_class_method).to eq("this is a mixed-in class method")
6
- end
7
-
8
- it "should have added a mixed-in instance method to FakedProject" do
9
- expect(subject.an_instance_method).to eq("this is a mixed-in instance method")
10
- end
11
-
12
- it "should have added a dyntamically-defined instance method to FakedProject" do
13
- expect(subject.dynamic).to eq("A dynamically defined instance method")
14
- end
15
- end
@@ -1,13 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe SomeClass do
4
- subject { SomeClass.new("foo") }
5
-
6
- it "should be reversible" do
7
- expect(subject.reverse).to eq("oof")
8
- end
9
-
10
- it "should compare with 'foo'" do
11
- expect(subject.compare_with("foo")).to be true
12
- end
13
- end
@@ -1,11 +0,0 @@
1
- require "bundler/setup"
2
-
3
- # We're injecting simplecov_config via aruba in cucumber here
4
- # depending on what the test case is...
5
- begin
6
- require File.join(File.dirname(__FILE__), "simplecov_config")
7
- rescue LoadError
8
- $stderr.puts "No SimpleCov config file found!"
9
- end
10
-
11
- require "faked_project"
@@ -1,11 +0,0 @@
1
- require "test_helper"
2
-
3
- class FakedTest < Test::Unit::TestCase
4
- def test_something
5
- assert_equal "bar", FakedProject.foo
6
- end
7
-
8
- def test_framework_specific
9
- assert_equal "Only tested in Test/Unit", FrameworkSpecific.test_unit
10
- end
11
- end
@@ -1,13 +0,0 @@
1
- require "test_helper"
2
-
3
- class MetaMagicTest < Test::Unit::TestCase
4
- def test_class_methods
5
- assert_equal "this is a mixed-in class method", FakedProject.a_class_method
6
- end
7
-
8
- def test_instance_methods
9
- p = FakedProject.new
10
- assert_equal "this is a mixed-in instance method", p.an_instance_method
11
- assert_equal "A dynamically defined instance method", p.dynamic
12
- end
13
- end
@@ -1,15 +0,0 @@
1
- require "test_helper"
2
-
3
- class SomeClassTest < Test::Unit::TestCase
4
- def setup
5
- @instance = SomeClass.new("foo")
6
- end
7
-
8
- def test_reverse
9
- assert_equal "oof", @instance.reverse
10
- end
11
-
12
- def test_comparison
13
- assert @instance.compare_with("foo")
14
- end
15
- end
@@ -1,12 +0,0 @@
1
- require "bundler/setup"
2
-
3
- # We're injecting simplecov_config via aruba in cucumber here
4
- # depending on what the test case is...
5
- begin
6
- require File.join(File.dirname(__FILE__), "simplecov_config")
7
- rescue LoadError
8
- $stderr.puts "No SimpleCov config file found!"
9
- end
10
-
11
- require "faked_project"
12
- require "test/unit"
@@ -1,50 +0,0 @@
1
- require "helper"
2
-
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 DELETED
@@ -1,98 +0,0 @@
1
- require "helper"
2
-
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
8
-
9
- it "doesn't match a new SimpleCov::StringFilter 'foobar'" do
10
- expect(SimpleCov::StringFilter.new("foobar")).not_to be_matches subject
11
- end
12
-
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
16
-
17
- it "matches a new SimpleCov::StringFilter 'spec/fixtures'" do
18
- expect(SimpleCov::StringFilter.new("spec/fixtures")).to be_matches subject
19
- end
20
-
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
24
-
25
- it "matches a new SimpleCov::StringFilter 'sample.rb'" do
26
- expect(SimpleCov::StringFilter.new("sample.rb")).to be_matches subject
27
- end
28
-
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
31
- end
32
-
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
35
- end
36
-
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
39
- end
40
-
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
43
- end
44
-
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
47
- end
48
-
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 = []
53
- end
54
-
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
66
- end
67
-
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
96
- end
97
- end
98
- end