simplecov 0.15.1 → 0.18.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +74 -1
  3. data/CODE_OF_CONDUCT.md +76 -0
  4. data/CONTRIBUTING.md +12 -9
  5. data/ISSUE_TEMPLATE.md +23 -0
  6. data/{MIT-LICENSE → LICENSE} +0 -0
  7. data/README.md +205 -104
  8. data/doc/alternate-formatters.md +20 -0
  9. data/lib/simplecov.rb +246 -52
  10. data/lib/simplecov/combine.rb +30 -0
  11. data/lib/simplecov/combine/branches_combiner.rb +32 -0
  12. data/lib/simplecov/combine/files_combiner.rb +25 -0
  13. data/lib/simplecov/combine/lines_combiner.rb +43 -0
  14. data/lib/simplecov/combine/results_combiner.rb +60 -0
  15. data/lib/simplecov/command_guesser.rb +8 -3
  16. data/lib/simplecov/configuration.rb +79 -8
  17. data/lib/simplecov/defaults.rb +12 -81
  18. data/lib/simplecov/exit_codes.rb +2 -0
  19. data/lib/simplecov/file_list.rb +32 -3
  20. data/lib/simplecov/filter.rb +5 -2
  21. data/lib/simplecov/formatter.rb +2 -0
  22. data/lib/simplecov/formatter/multi_formatter.rb +4 -2
  23. data/lib/simplecov/formatter/simple_formatter.rb +6 -4
  24. data/lib/simplecov/last_run.rb +4 -0
  25. data/lib/simplecov/lines_classifier.rb +21 -5
  26. data/lib/simplecov/load_global_config.rb +2 -0
  27. data/lib/simplecov/no_defaults.rb +2 -0
  28. data/lib/simplecov/profiles.rb +11 -7
  29. data/lib/simplecov/profiles/bundler_filter.rb +5 -0
  30. data/lib/simplecov/profiles/hidden_filter.rb +5 -0
  31. data/lib/simplecov/profiles/rails.rb +18 -0
  32. data/lib/simplecov/profiles/root_filter.rb +10 -0
  33. data/lib/simplecov/profiles/test_frameworks.rb +8 -0
  34. data/lib/simplecov/result.rb +23 -4
  35. data/lib/simplecov/result_adapter.rb +30 -0
  36. data/lib/simplecov/result_merger.rb +14 -11
  37. data/lib/simplecov/simulate_coverage.rb +29 -0
  38. data/lib/simplecov/source_file.rb +222 -110
  39. data/lib/simplecov/source_file/branch.rb +106 -0
  40. data/lib/simplecov/source_file/line.rb +72 -0
  41. data/lib/simplecov/useless_results_remover.rb +16 -0
  42. data/lib/simplecov/version.rb +3 -1
  43. metadata +44 -162
  44. data/.gitignore +0 -31
  45. data/.rspec +0 -3
  46. data/.rubocop.yml +0 -88
  47. data/.travis.yml +0 -29
  48. data/.yardopts +0 -1
  49. data/Gemfile +0 -38
  50. data/Rakefile +0 -39
  51. data/cucumber.yml +0 -13
  52. data/features/config_autoload.feature +0 -46
  53. data/features/config_command_name.feature +0 -45
  54. data/features/config_coverage_dir.feature +0 -33
  55. data/features/config_deactivate_merging.feature +0 -42
  56. data/features/config_formatters.feature +0 -77
  57. data/features/config_merge_timeout.feature +0 -39
  58. data/features/config_nocov_token.feature +0 -79
  59. data/features/config_profiles.feature +0 -44
  60. data/features/config_project_name.feature +0 -27
  61. data/features/config_styles.feature +0 -121
  62. data/features/config_tracked_files.feature +0 -29
  63. data/features/config_tracked_files_relevant_lines.feature +0 -31
  64. data/features/cucumber_basic.feature +0 -29
  65. data/features/maximum_coverage_drop.feature +0 -89
  66. data/features/merging_test_unit_and_rspec.feature +0 -44
  67. data/features/minimum_coverage.feature +0 -59
  68. data/features/refuse_coverage_drop.feature +0 -95
  69. data/features/rspec_basic.feature +0 -32
  70. data/features/rspec_fails_on_initialization.feature +0 -14
  71. data/features/rspec_groups_and_filters_basic.feature +0 -29
  72. data/features/rspec_groups_and_filters_complex.feature +0 -37
  73. data/features/rspec_groups_using_filter_class.feature +0 -41
  74. data/features/rspec_without_simplecov.feature +0 -20
  75. data/features/skipping_code_blocks_manually.feature +0 -70
  76. data/features/step_definitions/html_steps.rb +0 -44
  77. data/features/step_definitions/simplecov_steps.rb +0 -68
  78. data/features/step_definitions/transformers.rb +0 -13
  79. data/features/step_definitions/web_steps.rb +0 -64
  80. data/features/support/aruba_freedom_patch.rb +0 -53
  81. data/features/support/env.rb +0 -50
  82. data/features/test_unit_basic.feature +0 -34
  83. data/features/test_unit_groups_and_filters_basic.feature +0 -29
  84. data/features/test_unit_groups_and_filters_complex.feature +0 -35
  85. data/features/test_unit_groups_using_filter_class.feature +0 -40
  86. data/features/test_unit_without_simplecov.feature +0 -20
  87. data/features/unicode_compatiblity.feature +0 -67
  88. data/lib/simplecov/jruby_fix.rb +0 -42
  89. data/lib/simplecov/railtie.rb +0 -7
  90. data/lib/simplecov/railties/tasks.rake +0 -11
  91. data/lib/simplecov/raw_coverage.rb +0 -39
  92. data/simplecov.gemspec +0 -27
  93. data/spec/1_8_fallbacks_spec.rb +0 -31
  94. data/spec/command_guesser_spec.rb +0 -48
  95. data/spec/config_loader_spec.rb +0 -14
  96. data/spec/configuration_spec.rb +0 -35
  97. data/spec/defaults_spec.rb +0 -41
  98. data/spec/deleted_source_spec.rb +0 -12
  99. data/spec/faked_project/Gemfile +0 -6
  100. data/spec/faked_project/Rakefile +0 -8
  101. data/spec/faked_project/cucumber.yml +0 -13
  102. data/spec/faked_project/features/step_definitions/my_steps.rb +0 -22
  103. data/spec/faked_project/features/support/env.rb +0 -12
  104. data/spec/faked_project/features/test_stuff.feature +0 -6
  105. data/spec/faked_project/lib/faked_project.rb +0 -11
  106. data/spec/faked_project/lib/faked_project/framework_specific.rb +0 -18
  107. data/spec/faked_project/lib/faked_project/meta_magic.rb +0 -24
  108. data/spec/faked_project/lib/faked_project/some_class.rb +0 -28
  109. data/spec/faked_project/lib/faked_project/untested_class.rb +0 -11
  110. data/spec/faked_project/spec/faked_spec.rb +0 -11
  111. data/spec/faked_project/spec/forking_spec.rb +0 -8
  112. data/spec/faked_project/spec/meta_magic_spec.rb +0 -15
  113. data/spec/faked_project/spec/some_class_spec.rb +0 -13
  114. data/spec/faked_project/spec/spec_helper.rb +0 -11
  115. data/spec/faked_project/test/faked_test.rb +0 -11
  116. data/spec/faked_project/test/meta_magic_test.rb +0 -13
  117. data/spec/faked_project/test/some_class_test.rb +0 -15
  118. data/spec/faked_project/test/test_helper.rb +0 -12
  119. data/spec/file_list_spec.rb +0 -50
  120. data/spec/filters_spec.rb +0 -202
  121. data/spec/fixtures/app/controllers/sample_controller.rb +0 -10
  122. data/spec/fixtures/app/models/user.rb +0 -10
  123. data/spec/fixtures/deleted_source_sample.rb +0 -15
  124. data/spec/fixtures/frameworks/rspec_bad.rb +0 -9
  125. data/spec/fixtures/frameworks/rspec_good.rb +0 -9
  126. data/spec/fixtures/frameworks/testunit_bad.rb +0 -9
  127. data/spec/fixtures/frameworks/testunit_good.rb +0 -9
  128. data/spec/fixtures/iso-8859.rb +0 -3
  129. data/spec/fixtures/never.rb +0 -2
  130. data/spec/fixtures/resultset1.rb +0 -4
  131. data/spec/fixtures/resultset2.rb +0 -4
  132. data/spec/fixtures/sample.rb +0 -16
  133. data/spec/fixtures/skipped.rb +0 -4
  134. data/spec/fixtures/skipped_and_executed.rb +0 -8
  135. data/spec/fixtures/utf-8.rb +0 -3
  136. data/spec/helper.rb +0 -26
  137. data/spec/last_run_spec.rb +0 -48
  138. data/spec/lines_classifier_spec.rb +0 -103
  139. data/spec/multi_formatter_spec.rb +0 -20
  140. data/spec/raw_coverage_spec.rb +0 -92
  141. data/spec/result_merger_spec.rb +0 -171
  142. data/spec/result_spec.rb +0 -209
  143. data/spec/return_codes_spec.rb +0 -34
  144. data/spec/simplecov_spec.rb +0 -109
  145. data/spec/source_file_line_spec.rb +0 -155
  146. data/spec/source_file_spec.rb +0 -145
  147. data/spec/support/fail_rspec_on_ruby_warning.rb +0 -75
data/.travis.yml DELETED
@@ -1,29 +0,0 @@
1
- language: ruby
2
-
3
- before_install:
4
- - gem update --system
5
- - gem install bundler
6
-
7
- bundler_args: --without development --jobs=3 --retry=3
8
-
9
- cache: bundler
10
-
11
- sudo: false
12
-
13
- rvm:
14
- - 1.8.7
15
- - 1.9.3
16
- - 2.0.0
17
- - 2.1.10
18
- - 2.2.7
19
- - 2.3.4
20
- - 2.4.1
21
- - jruby-9.1.13.0
22
- - ruby-head
23
- - jruby-head
24
-
25
- matrix:
26
- allow_failures:
27
- - rvm: ruby-head
28
- - rvm: jruby-head
29
- fast_finish: true
data/.yardopts DELETED
@@ -1 +0,0 @@
1
- - **/*.md
data/Gemfile DELETED
@@ -1,38 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Uncomment this to use local copy of simplecov-html in development when checked out
4
- # gem 'simplecov-html', :path => ::File.dirname(__FILE__) + '/../simplecov-html'
5
-
6
- # Uncomment this to use development version of html formatter from github
7
- # gem 'simplecov-html', :github => 'colszowka/simplecov-html'
8
-
9
- gem "rake", Gem::Version.new(RUBY_VERSION) < Gem::Version.new("1.9.3") ? "~>10.3" : ">= 10.3"
10
-
11
- group :test do
12
- gem "rspec", ">= 3.2"
13
- # Older versions of some gems required for Ruby 1.8.7 support
14
- platforms :ruby_18 do
15
- gem "activesupport", "~> 3.2.21"
16
- gem "i18n", "~> 0.6.11"
17
- end
18
- platforms :ruby_18, :ruby_19 do
19
- gem "mime-types", "~> 1.25"
20
- gem "addressable", "~> 2.3.0"
21
- end
22
- platforms :ruby_18, :ruby_19, :ruby_20, :ruby_21 do
23
- gem "rack", "~> 1.6"
24
- end
25
- platforms :jruby, :ruby_19, :ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24, :ruby_25 do
26
- gem "aruba", "~> 0.14"
27
- gem "capybara"
28
- gem "nokogiri", RUBY_VERSION < "2.1" ? "~> 1.6.0" : ">= 1.7"
29
- gem "cucumber"
30
- gem "phantomjs", "~> 2.1"
31
- gem "poltergeist"
32
- gem "rubocop", "0.49.1" unless RUBY_VERSION.start_with?("1.")
33
- gem "test-unit"
34
- end
35
- gem "json", RUBY_VERSION.start_with?("1.") ? "~> 1.8" : "~> 2.0"
36
- end
37
-
38
- gemspec
data/Rakefile DELETED
@@ -1,39 +0,0 @@
1
- require "rubygems"
2
- require "bundler/setup"
3
- Bundler::GemHelper.install_tasks
4
-
5
- # See https://github.com/colszowka/simplecov/issues/171
6
- desc "Set permissions on all files so they are compatible with both user-local and system-wide installs"
7
- task :fix_permissions do
8
- system 'bash -c "find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;"'
9
- end
10
- # Enforce proper permissions on each build
11
- Rake::Task[:build].prerequisites.unshift :fix_permissions
12
-
13
- require "rspec/core/rake_task"
14
- RSpec::Core::RakeTask.new(:spec) do |spec|
15
- spec.pattern = FileList["spec/*_spec.rb"]
16
- end
17
-
18
- begin
19
- require "rubocop/rake_task"
20
- RuboCop::RakeTask.new
21
- rescue LoadError
22
- task :rubocop do
23
- $stderr.puts "Rubocop is disabled"
24
- end
25
- end
26
-
27
- # Cucumber integration test suite is for impls that work with simplecov only - a.k.a. 1.9+
28
- if RUBY_VERSION.start_with? "1.8"
29
- task :default => [:spec]
30
- else
31
- require "cucumber/rake/task"
32
- Cucumber::Rake::Task.new
33
-
34
- if RUBY_VERSION.start_with? "1.9"
35
- task :default => [:spec, :cucumber]
36
- else
37
- task :default => [:rubocop, :spec, :cucumber]
38
- end
39
- end
data/cucumber.yml DELETED
@@ -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,46 +0,0 @@
1
- @test_unit @rspec @config
2
- Feature:
3
-
4
- If you have multiple test suites, it can be a bit cumbersome
5
- to keep the configuration across them in sync. SimpleCov
6
- is able to find a config file called '.simplecov' that resides
7
- in your project's root and will automatically use it when
8
- loaded.
9
-
10
- This gives you the ability to configure SimpleCov just once
11
- and then use the same configuration on all test suites simply
12
- by doing a 'require "simplecov"'
13
-
14
- Scenario:
15
- Given a file named ".simplecov" with:
16
- """
17
- SimpleCov.start do
18
- add_filter 'test.rb'
19
- add_filter 'spec.rb'
20
- end
21
- """
22
- Given SimpleCov for Test/Unit is configured with:
23
- """
24
- require 'simplecov'
25
- """
26
- Given SimpleCov for RSpec is configured with:
27
- """
28
- require 'simplecov'
29
- """
30
-
31
- When I successfully run `bundle exec rake test`
32
- And I open the coverage report generated with `bundle exec rspec spec`
33
- Then the report should be based upon:
34
- | RSpec |
35
- | Unit Tests |
36
-
37
- And I should see the groups:
38
- | name | coverage | files |
39
- | All Files | 90.48% | 4 |
40
-
41
- And I should see the source files:
42
- | name | coverage |
43
- | lib/faked_project.rb | 100.0 % |
44
- | lib/faked_project/some_class.rb | 80.0 % |
45
- | lib/faked_project/framework_specific.rb | 87.5 % |
46
- | lib/faked_project/meta_magic.rb | 100.0 % |
@@ -1,45 +0,0 @@
1
- @test_unit @rspec @merging @config
2
- Feature: Custom names for individual test suites
3
-
4
- Each test suite needs a name it can be identified by. SimpleCov tries
5
- best to detect Rails' Unit, Functional, Integration tests as well as regular
6
- Test/Unit, RSpec and Cucumber, but if that is insufficient, each test suite
7
- config can be given a custom command name using SimpleCov.command_name.
8
-
9
- Scenario:
10
- Given SimpleCov for Test/Unit is configured with:
11
- """
12
- require 'simplecov'
13
- SimpleCov.start do
14
- command_name "I'm in UR Unitz"
15
- end
16
- """
17
- Given SimpleCov for RSpec is configured with:
18
- """
19
- require 'simplecov'
20
- SimpleCov.start do
21
- command_name "Dreck macht Speck"
22
- end
23
- """
24
-
25
- When I open the coverage report generated with `bundle exec rake test`
26
- Then the report should be based upon:
27
- | I'm in UR Unitz |
28
-
29
- When I open the coverage report generated with `bundle exec rspec spec`
30
- Then the report should be based upon:
31
- | Dreck macht Speck |
32
- | I'm in UR Unitz |
33
-
34
- Scenario: RSpec auto detection with spec/features
35
- Given SimpleCov for RSpec is configured with:
36
- """
37
- require 'simplecov'
38
- SimpleCov.start
39
- """
40
- And a file named "spec/features/foobar_spec.rb" with:
41
- """
42
- """
43
- When I open the coverage report generated with `bundle exec rspec spec`
44
- Then the report should be based upon:
45
- | RSpec |
@@ -1,33 +0,0 @@
1
- @test_unit @config
2
- Feature:
3
-
4
- The output directory for test coverage can be customized
5
- with the SimpleCov.coverage_dir setting. All coverage reports
6
- will be put there instead of the default 'coverage' directory
7
- in your project's root.
8
-
9
- Scenario:
10
- Given SimpleCov for Test/Unit is configured with:
11
- """
12
- require 'simplecov'
13
- SimpleCov.start do
14
- coverage_dir 'test/simplecov'
15
- end
16
- """
17
-
18
- When I successfully run `bundle exec rake test`
19
- Then a coverage report should have been generated in "test/simplecov"
20
- And a directory named "coverage" should not exist
21
-
22
- Scenario:
23
- Given SimpleCov for Test/Unit is configured with:
24
- """
25
- require 'simplecov'
26
- SimpleCov.start do
27
- coverage_dir '/tmp/test/simplecov'
28
- end
29
- """
30
-
31
- When I successfully run `bundle exec rake test`
32
- Then a coverage report should have been generated in "/tmp/test/simplecov"
33
- And a directory named "coverage" should not exist
@@ -1,42 +0,0 @@
1
- @test_unit @rspec @merging @config
2
- Feature:
3
-
4
- If merging of test suite results is not desired, it can be deactivated,
5
- thus leading to the coverage report being overwritten with the latest results
6
- of a single test suite on each run of any suite.
7
-
8
- It's probably preferrable to generate the individual suite results into separate
9
- output directories instead (see SimpleCov.coverage_dir), but it is possible :)
10
-
11
- Scenario:
12
- Given SimpleCov for Test/Unit is configured with:
13
- """
14
- require 'simplecov'
15
- SimpleCov.start do
16
- use_merging false
17
- end
18
- """
19
- Given SimpleCov for RSpec is configured with:
20
- """
21
- require 'simplecov'
22
- SimpleCov.start do
23
- use_merging false
24
- end
25
- """
26
-
27
- When I successfully run `bundle exec rake test`
28
- Then a file named "coverage/index.html" should exist
29
- But a file named "coverage/.resultset.json" should not exist
30
-
31
- Given I open the coverage report
32
- Then the report should be based upon:
33
- | Unit Tests |
34
-
35
- When I successfully run `bundle exec rspec spec`
36
- Then a file named "coverage/index.html" should exist
37
- But a file named "coverage/.resultset.json" should not exist
38
-
39
- Given I open the coverage report
40
- Then the report should be based upon:
41
- | RSpec |
42
-
@@ -1,77 +0,0 @@
1
- @test_unit @config
2
- Feature:
3
-
4
- The formatter for test coverage can be customized
5
- with the SimpleCov.formatter setting. There are two
6
- built-in formatters:
7
- SimpleCov::Formatter::SimpleFormatter is a simple
8
- formatter returning a string of all files with
9
- theirs coverages.
10
- SimpleCov::Formatter::MultiFormatter is a formatter
11
- used to call multiple formatters at once.
12
-
13
- Scenario: With SimpleFormatter
14
- Given SimpleCov for Test/Unit is configured with:
15
- """
16
- require 'simplecov'
17
- SimpleCov.formatter = SimpleCov::Formatter::SimpleFormatter
18
- SimpleCov.at_exit do
19
- puts SimpleCov.result.format!
20
- end
21
- SimpleCov.start do
22
- add_group 'Libs', 'lib/faked_project/'
23
- end
24
- """
25
-
26
- When I successfully run `bundle exec rake test`
27
- Then the output should contain "lib/faked_project/meta_magic.rb (coverage: 100.0%)"
28
-
29
- Scenario: With MultiFormatter
30
- Given SimpleCov for Test/Unit is configured with:
31
- """
32
- require 'simplecov'
33
- SimpleCov.formatters = [
34
- SimpleCov::Formatter::SimpleFormatter,
35
- Class.new do
36
- def format(result)
37
- raise "Unable to format"
38
- end
39
- end
40
- ]
41
-
42
- SimpleCov.at_exit do
43
- puts SimpleCov.result.format!.join
44
- end
45
- SimpleCov.start do
46
- add_group 'Libs', 'lib/faked_project/'
47
- end
48
- """
49
-
50
- When I successfully run `bundle exec rake test`
51
- Then the output should contain "lib/faked_project/meta_magic.rb (coverage: 100.0%)"
52
- And the output should match /Formatter [^\s]* failed with RuntimeError: Unable to format/
53
-
54
- Scenario: With multiple formatters
55
- Given SimpleCov for Test/Unit is configured with:
56
- """
57
- require 'simplecov'
58
- SimpleCov.formatters = [
59
- SimpleCov::Formatter::SimpleFormatter,
60
- Class.new do
61
- def format(result)
62
- raise "Unable to format"
63
- end
64
- end
65
- ]
66
-
67
- SimpleCov.at_exit do
68
- puts SimpleCov.result.format!.join
69
- end
70
- SimpleCov.start do
71
- add_group 'Libs', 'lib/faked_project/'
72
- end
73
- """
74
-
75
- When I successfully run `bundle exec rake test`
76
- Then the output should contain "lib/faked_project/meta_magic.rb (coverage: 100.0%)"
77
- And the output should match /Formatter [^\s]* failed with RuntimeError: Unable to format/
@@ -1,39 +0,0 @@
1
- @test_unit @rspec @merging @config
2
- Feature:
3
-
4
- The maximum time between resultset merges can be customized
5
- using SimpleCov.merge_timeout SECONDS. This can be helpful for
6
- long-running test-suites that fail to merge because of the time
7
- between individual suite finishes is more then the default timeout
8
- of 10 minutes.
9
-
10
- Here, for the sake of testing the opposite case is shown, choosing
11
- a merge timeout so short that the first test suite's results actually
12
- are out of date when the second suite finishes and thus does not end up
13
- in the report.
14
-
15
- Scenario:
16
- Given SimpleCov for Test/Unit is configured with:
17
- """
18
- require 'simplecov'
19
- SimpleCov.start do
20
- merge_timeout 5
21
- end
22
- """
23
- Given SimpleCov for RSpec is configured with:
24
- """
25
- require 'simplecov'
26
- SimpleCov.start do
27
- merge_timeout 5
28
- end
29
- """
30
-
31
- When I open the coverage report generated with `bundle exec rake test`
32
- Then the report should be based upon:
33
- | Unit Tests |
34
-
35
- When I wait for 5 seconds
36
- And I open the coverage report generated with `bundle exec rspec spec`
37
- Then the report should be based upon:
38
- | RSpec |
39
-
@@ -1,79 +0,0 @@
1
- @test_unit @nocov
2
- Feature:
3
-
4
- Code wrapped in # :nocov: will be ignored by coverage reports.
5
- The name of the token can be configured with SimpleCov.nocov_token or SimpleCov.skip_token
6
-
7
- Scenario: Custom nocov token using nocov_token
8
- Given SimpleCov for Test/Unit is configured with:
9
- """
10
- require 'simplecov'
11
- SimpleCov.start 'test_frameworks' do
12
- nocov_token 'skippit'
13
- end
14
- """
15
-
16
- Given a file named "lib/faked_project/nocov.rb" with:
17
- """
18
- class SourceCodeWithNocov
19
- # :skippit:
20
- def some_weird_code
21
- never_reached
22
- rescue => err
23
- but no one cares about invalid ruby here
24
- end
25
- # :skippit:
26
- end
27
- """
28
-
29
- When I open the coverage report generated with `bundle exec rake test`
30
-
31
- Then I should see the source files:
32
- | name | coverage |
33
- | lib/faked_project.rb | 100.0 % |
34
- | lib/faked_project/some_class.rb | 80.0 % |
35
- | lib/faked_project/framework_specific.rb | 75.0 % |
36
- | lib/faked_project/meta_magic.rb | 100.0 % |
37
- | lib/faked_project/nocov.rb | 100.0 % |
38
-
39
- And there should be 7 skipped lines in the source files
40
-
41
- And the report should be based upon:
42
- | Unit Tests |
43
-
44
- Scenario: Custom nocov token using skip_token
45
- Given SimpleCov for Test/Unit is configured with:
46
- """
47
- require 'simplecov'
48
- SimpleCov.start 'test_frameworks' do
49
- skip_token 'skippit'
50
- end
51
- """
52
-
53
- Given a file named "lib/faked_project/nocov.rb" with:
54
- """
55
- class SourceCodeWithNocov
56
- # :skippit:
57
- def some_weird_code
58
- never_reached
59
- rescue => err
60
- but no one cares about invalid ruby here
61
- end
62
- # :skippit:
63
- end
64
- """
65
-
66
- When I open the coverage report generated with `bundle exec rake test`
67
-
68
- Then I should see the source files:
69
- | name | coverage |
70
- | lib/faked_project.rb | 100.0 % |
71
- | lib/faked_project/some_class.rb | 80.0 % |
72
- | lib/faked_project/framework_specific.rb | 75.0 % |
73
- | lib/faked_project/meta_magic.rb | 100.0 % |
74
- | lib/faked_project/nocov.rb | 100.0 % |
75
-
76
- And there should be 7 skipped lines in the source files
77
-
78
- And the report should be based upon:
79
- | Unit Tests |