simplecov 0.8.0.pre2 → 0.18.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +368 -27
- data/CODE_OF_CONDUCT.md +76 -0
- data/CONTRIBUTING.md +38 -7
- data/ISSUE_TEMPLATE.md +23 -0
- data/{MIT-LICENSE → LICENSE} +1 -1
- data/README.md +449 -230
- data/doc/alternate-formatters.md +61 -0
- data/doc/commercial-services.md +20 -0
- data/doc/editor-integration.md +18 -0
- data/lib/simplecov.rb +294 -59
- data/lib/simplecov/combine.rb +30 -0
- data/lib/simplecov/combine/branches_combiner.rb +32 -0
- data/lib/simplecov/combine/files_combiner.rb +25 -0
- data/lib/simplecov/combine/lines_combiner.rb +43 -0
- data/lib/simplecov/combine/results_combiner.rb +60 -0
- data/lib/simplecov/command_guesser.rb +46 -40
- data/lib/simplecov/configuration.rb +346 -221
- data/lib/simplecov/defaults.rb +35 -75
- data/lib/simplecov/exit_codes.rb +9 -4
- data/lib/simplecov/file_list.rb +80 -36
- data/lib/simplecov/filter.rb +51 -3
- data/lib/simplecov/formatter.rb +4 -2
- data/lib/simplecov/formatter/multi_formatter.rb +28 -19
- data/lib/simplecov/formatter/simple_formatter.rb +21 -15
- data/lib/simplecov/last_run.rb +21 -13
- data/lib/simplecov/lines_classifier.rb +48 -0
- data/lib/simplecov/load_global_config.rb +8 -0
- data/lib/simplecov/no_defaults.rb +4 -2
- data/lib/simplecov/profiles.rb +29 -23
- data/lib/simplecov/profiles/bundler_filter.rb +5 -0
- data/lib/simplecov/profiles/hidden_filter.rb +5 -0
- data/lib/simplecov/profiles/rails.rb +18 -0
- data/lib/simplecov/profiles/root_filter.rb +10 -0
- data/lib/simplecov/profiles/test_frameworks.rb +8 -0
- data/lib/simplecov/result.rb +39 -68
- data/lib/simplecov/result_adapter.rb +30 -0
- data/lib/simplecov/result_merger.rb +110 -60
- data/lib/simplecov/simulate_coverage.rb +29 -0
- data/lib/simplecov/source_file.rb +261 -135
- data/lib/simplecov/source_file/branch.rb +106 -0
- data/lib/simplecov/source_file/line.rb +72 -0
- data/lib/simplecov/useless_results_remover.rb +16 -0
- data/lib/simplecov/version.rb +4 -2
- metadata +48 -197
- data/.gitignore +0 -32
- data/.travis.yml +0 -28
- data/.yardopts +0 -1
- data/Appraisals +0 -8
- data/Gemfile +0 -16
- data/Rakefile +0 -32
- data/cucumber.yml +0 -13
- data/features/config_autoload.feature +0 -46
- data/features/config_command_name.feature +0 -45
- data/features/config_coverage_dir.feature +0 -33
- data/features/config_deactivate_merging.feature +0 -42
- data/features/config_formatters.feature +0 -52
- data/features/config_merge_timeout.feature +0 -39
- data/features/config_nocov_token.feature +0 -79
- data/features/config_profiles.feature +0 -44
- data/features/config_project_name.feature +0 -27
- data/features/config_styles.feature +0 -121
- data/features/cucumber_basic.feature +0 -29
- data/features/maximum_coverage_drop.feature +0 -36
- data/features/merging_test_unit_and_rspec.feature +0 -44
- data/features/minimum_coverage.feature +0 -59
- data/features/refuse_coverage_drop.feature +0 -35
- data/features/rspec_basic.feature +0 -31
- data/features/rspec_fails_on_initialization.feature +0 -14
- data/features/rspec_groups_and_filters_basic.feature +0 -29
- data/features/rspec_groups_and_filters_complex.feature +0 -35
- data/features/rspec_groups_using_filter_class.feature +0 -40
- data/features/rspec_without_simplecov.feature +0 -20
- data/features/skipping_code_blocks_manually.feature +0 -70
- data/features/step_definitions/html_steps.rb +0 -45
- data/features/step_definitions/simplecov_steps.rb +0 -66
- data/features/step_definitions/transformers.rb +0 -13
- data/features/step_definitions/web_steps.rb +0 -64
- data/features/support/env.rb +0 -44
- data/features/test_unit_basic.feature +0 -34
- data/features/test_unit_groups_and_filters_basic.feature +0 -29
- data/features/test_unit_groups_and_filters_complex.feature +0 -35
- data/features/test_unit_groups_using_filter_class.feature +0 -40
- data/features/test_unit_without_simplecov.feature +0 -20
- data/features/unicode_compatiblity.feature +0 -67
- data/gemfiles/multi_json_legacy.gemfile +0 -12
- data/gemfiles/multi_json_new.gemfile +0 -12
- data/lib/simplecov/jruby16_fix.rb +0 -43
- data/lib/simplecov/json.rb +0 -27
- data/lib/simplecov/merge_helpers.rb +0 -39
- data/lib/simplecov/railtie.rb +0 -7
- data/lib/simplecov/railties/tasks.rake +0 -11
- data/simplecov.gemspec +0 -30
- data/test/faked_project/Gemfile +0 -6
- data/test/faked_project/Rakefile +0 -8
- data/test/faked_project/cucumber.yml +0 -13
- data/test/faked_project/features/step_definitions/my_steps.rb +0 -23
- data/test/faked_project/features/support/env.rb +0 -12
- data/test/faked_project/features/test_stuff.feature +0 -6
- data/test/faked_project/lib/faked_project.rb +0 -11
- data/test/faked_project/lib/faked_project/framework_specific.rb +0 -18
- data/test/faked_project/lib/faked_project/meta_magic.rb +0 -24
- data/test/faked_project/lib/faked_project/some_class.rb +0 -29
- data/test/faked_project/spec/faked_spec.rb +0 -11
- data/test/faked_project/spec/meta_magic_spec.rb +0 -10
- data/test/faked_project/spec/some_class_spec.rb +0 -10
- data/test/faked_project/spec/spec_helper.rb +0 -15
- data/test/faked_project/test/faked_test.rb +0 -11
- data/test/faked_project/test/meta_magic_test.rb +0 -13
- data/test/faked_project/test/some_class_test.rb +0 -15
- data/test/faked_project/test/test_helper.rb +0 -16
- data/test/fixtures/app/controllers/sample_controller.rb +0 -10
- data/test/fixtures/app/models/user.rb +0 -10
- data/test/fixtures/deleted_source_sample.rb +0 -15
- data/test/fixtures/frameworks/rspec_bad.rb +0 -9
- data/test/fixtures/frameworks/rspec_good.rb +0 -9
- data/test/fixtures/frameworks/testunit_bad.rb +0 -9
- data/test/fixtures/frameworks/testunit_good.rb +0 -9
- data/test/fixtures/iso-8859.rb +0 -3
- data/test/fixtures/resultset1.rb +0 -4
- data/test/fixtures/resultset2.rb +0 -5
- data/test/fixtures/sample.rb +0 -16
- data/test/fixtures/utf-8.rb +0 -3
- data/test/helper.rb +0 -34
- data/test/shoulda_macros.rb +0 -19
- data/test/test_1_8_fallbacks.rb +0 -31
- data/test/test_command_guesser.rb +0 -19
- data/test/test_deleted_source.rb +0 -14
- data/test/test_file_list.rb +0 -22
- data/test/test_filters.rb +0 -78
- data/test/test_merge_helpers.rb +0 -105
- data/test/test_result.rb +0 -160
- data/test/test_return_codes.rb +0 -37
- data/test/test_source_file.rb +0 -106
- data/test/test_source_file_line.rb +0 -106
@@ -1,106 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class TestSourceFileLine < Test::Unit::TestCase
|
4
|
-
context "A source line" do
|
5
|
-
setup do
|
6
|
-
@line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 3)
|
7
|
-
end
|
8
|
-
subject { @line }
|
9
|
-
|
10
|
-
should 'return "# the ruby source" as src' do
|
11
|
-
assert_equal '# the ruby source', @line.src
|
12
|
-
end
|
13
|
-
|
14
|
-
should 'return the same for source as for src' do
|
15
|
-
assert_equal @line.src, @line.source
|
16
|
-
end
|
17
|
-
|
18
|
-
should 'have line number 5' do
|
19
|
-
assert_equal 5, @line.line_number
|
20
|
-
end
|
21
|
-
|
22
|
-
should 'have equal line_number, line and number' do
|
23
|
-
assert_equal @line.line_number, @line.line
|
24
|
-
assert_equal @line.line_number, @line.number
|
25
|
-
end
|
26
|
-
|
27
|
-
context "flagged as skipped!" do
|
28
|
-
setup { @line.skipped! }
|
29
|
-
|
30
|
-
should_not_be :covered?
|
31
|
-
should_be :skipped?
|
32
|
-
should_not_be :missed?
|
33
|
-
should_not_be :never?
|
34
|
-
should_have :status, 'skipped'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context "A source line with coverage" do
|
39
|
-
setup do
|
40
|
-
@line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 3)
|
41
|
-
end
|
42
|
-
subject { @line }
|
43
|
-
|
44
|
-
should "have coverage of 3" do
|
45
|
-
assert_equal 3, @line.coverage
|
46
|
-
end
|
47
|
-
|
48
|
-
should_be :covered?
|
49
|
-
should_not_be :skipped?
|
50
|
-
should_not_be :missed?
|
51
|
-
should_not_be :never?
|
52
|
-
should_have :status, 'covered'
|
53
|
-
end
|
54
|
-
|
55
|
-
context "A source line without coverage" do
|
56
|
-
setup do
|
57
|
-
@line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 0)
|
58
|
-
end
|
59
|
-
subject { @line }
|
60
|
-
|
61
|
-
should "have coverage of 0" do
|
62
|
-
assert_equal 0, @line.coverage
|
63
|
-
end
|
64
|
-
|
65
|
-
should_not_be :covered?
|
66
|
-
should_not_be :skipped?
|
67
|
-
should_be :missed?
|
68
|
-
should_not_be :never?
|
69
|
-
should_have :status, 'missed'
|
70
|
-
end
|
71
|
-
|
72
|
-
context "A source line with no code" do
|
73
|
-
setup do
|
74
|
-
@line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, nil)
|
75
|
-
end
|
76
|
-
subject { @line }
|
77
|
-
|
78
|
-
should "have nil coverage" do
|
79
|
-
assert_nil @line.coverage
|
80
|
-
end
|
81
|
-
|
82
|
-
should_not_be :covered?
|
83
|
-
should_not_be :skipped?
|
84
|
-
should_not_be :missed?
|
85
|
-
should_be :never?
|
86
|
-
should_have :status, 'never'
|
87
|
-
end
|
88
|
-
|
89
|
-
should "raise ArgumentError when initialized with invalid src" do
|
90
|
-
assert_raise ArgumentError do
|
91
|
-
SimpleCov::SourceFile::Line.new(:symbol, 5, 3)
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
should "raise ArgumentError when initialized with invalid line_number" do
|
96
|
-
assert_raise ArgumentError do
|
97
|
-
SimpleCov::SourceFile::Line.new("some source", "five", 3)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
should "raise ArgumentError when initialized with invalid coverage" do
|
102
|
-
assert_raise ArgumentError do
|
103
|
-
SimpleCov::SourceFile::Line.new("some source", 5, "three")
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end if SimpleCov.usable?
|