simplecov 0.4.2 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/.gitignore +4 -1
  2. data/.rvmrc +1 -1
  3. data/.travis.yml +9 -0
  4. data/CHANGELOG.md +64 -0
  5. data/Gemfile +7 -0
  6. data/README.rdoc +83 -66
  7. data/Rakefile +3 -7
  8. data/cucumber.yml +13 -0
  9. data/features/config_adapters.feature +44 -0
  10. data/features/config_autoload.feature +46 -0
  11. data/features/config_command_name.feature +33 -0
  12. data/features/config_coverage_dir.feature +20 -0
  13. data/features/config_deactivate_merging.feature +42 -0
  14. data/features/config_merge_timeout.feature +38 -0
  15. data/features/config_project_name.feature +27 -0
  16. data/features/config_styles.feature +93 -0
  17. data/features/cucumber_basic.feature +29 -0
  18. data/features/merging_test_unit_and_rspec.feature +44 -0
  19. data/features/rspec_basic.feature +31 -0
  20. data/features/rspec_groups_and_filters_basic.feature +29 -0
  21. data/features/rspec_groups_and_filters_complex.feature +35 -0
  22. data/features/rspec_without_simplecov.feature +20 -0
  23. data/features/step_definitions/html_steps.rb +42 -0
  24. data/features/step_definitions/simplecov_steps.rb +61 -0
  25. data/features/step_definitions/transformers.rb +13 -0
  26. data/features/step_definitions/web_steps.rb +64 -0
  27. data/features/support/env.rb +26 -0
  28. data/features/test_unit_basic.feature +34 -0
  29. data/features/test_unit_groups_and_filters_basic.feature +29 -0
  30. data/features/test_unit_groups_and_filters_complex.feature +35 -0
  31. data/features/test_unit_without_simplecov.feature +20 -0
  32. data/lib/simplecov.rb +15 -30
  33. data/lib/simplecov/adapters.rb +3 -26
  34. data/lib/simplecov/command_guesser.rb +2 -2
  35. data/lib/simplecov/configuration.rb +21 -21
  36. data/lib/simplecov/defaults.rb +48 -0
  37. data/lib/simplecov/file_list.rb +44 -0
  38. data/lib/simplecov/filter.rb +5 -5
  39. data/lib/simplecov/formatter.rb +1 -1
  40. data/lib/simplecov/formatter/simple_formatter.rb +1 -1
  41. data/lib/simplecov/jruby_float_fix.rb +1 -1
  42. data/lib/simplecov/merge_helpers.rb +4 -4
  43. data/lib/simplecov/result.rb +33 -30
  44. data/lib/simplecov/result_merger.rb +30 -13
  45. data/lib/simplecov/source_file.rb +78 -21
  46. data/lib/simplecov/version.rb +1 -1
  47. data/simplecov.gemspec +25 -22
  48. data/test/faked_project/Gemfile +6 -0
  49. data/test/faked_project/Rakefile +8 -0
  50. data/test/faked_project/cucumber.yml +13 -0
  51. data/test/faked_project/features/step_definitions/my_steps.rb +23 -0
  52. data/test/faked_project/features/support/env.rb +12 -0
  53. data/test/faked_project/features/test_stuff.feature +6 -0
  54. data/test/faked_project/lib/faked_project.rb +11 -0
  55. data/test/faked_project/lib/faked_project/framework_specific.rb +18 -0
  56. data/test/faked_project/lib/faked_project/meta_magic.rb +24 -0
  57. data/test/faked_project/lib/faked_project/some_class.rb +29 -0
  58. data/test/faked_project/spec/faked_spec.rb +11 -0
  59. data/test/faked_project/spec/meta_magic_spec.rb +10 -0
  60. data/test/faked_project/spec/some_class_spec.rb +10 -0
  61. data/test/faked_project/spec/spec_helper.rb +15 -0
  62. data/test/faked_project/test/faked_test.rb +11 -0
  63. data/test/faked_project/test/meta_magic_test.rb +13 -0
  64. data/test/faked_project/test/some_class_test.rb +15 -0
  65. data/test/faked_project/test/test_helper.rb +16 -0
  66. data/test/fixtures/app/controllers/sample_controller.rb +2 -2
  67. data/test/fixtures/app/models/user.rb +2 -2
  68. data/test/fixtures/frameworks/rspec_bad.rb +1 -1
  69. data/test/fixtures/frameworks/rspec_good.rb +1 -1
  70. data/test/fixtures/frameworks/testunit_bad.rb +1 -1
  71. data/test/fixtures/frameworks/testunit_good.rb +1 -1
  72. data/test/fixtures/resultset1.rb +1 -1
  73. data/test/fixtures/resultset2.rb +1 -1
  74. data/test/fixtures/sample.rb +8 -2
  75. data/test/helper.rb +17 -4
  76. data/test/shoulda_macros.rb +2 -2
  77. data/test/test_1_8_fallbacks.rb +3 -3
  78. data/test/test_command_guesser.rb +3 -3
  79. data/test/test_file_list.rb +24 -0
  80. data/test/test_filters.rb +18 -13
  81. data/test/test_merge_helpers.rb +23 -23
  82. data/test/test_result.rb +40 -31
  83. data/test/test_return_codes.rb +5 -5
  84. data/test/test_source_file.rb +39 -15
  85. data/test/test_source_file_line.rb +22 -22
  86. metadata +191 -53
  87. data/.document +0 -5
@@ -6,103 +6,103 @@ class TestSourceFileLine < Test::Unit::TestCase
6
6
  setup do
7
7
  @line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 3)
8
8
  end
9
-
9
+
10
10
  should 'return "# the ruby source" as src' do
11
11
  assert_equal '# the ruby source', @line.src
12
12
  end
13
-
13
+
14
14
  should 'return the same for source as for src' do
15
15
  assert_equal @line.src, @line.source
16
16
  end
17
-
17
+
18
18
  should 'have line number 5' do
19
19
  assert_equal 5, @line.line_number
20
20
  end
21
-
21
+
22
22
  should 'have equal line_number, line and number' do
23
23
  assert_equal @line.line_number, @line.line
24
24
  assert_equal @line.line_number, @line.number
25
25
  end
26
26
  end
27
-
27
+
28
28
  context "A source line with coverage" do
29
29
  setup do
30
30
  @line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 3)
31
31
  end
32
-
32
+
33
33
  should "have coverage of 3" do
34
34
  assert_equal 3, @line.coverage
35
35
  end
36
-
36
+
37
37
  should "be covered?" do
38
38
  assert @line.covered?
39
39
  end
40
-
40
+
41
41
  should "not be never?" do
42
42
  assert !@line.never?
43
43
  end
44
-
44
+
45
45
  should "not be missed?" do
46
46
  assert !@line.missed?
47
47
  end
48
48
  end
49
-
49
+
50
50
  context "A source line without coverage" do
51
51
  setup do
52
52
  @line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 0)
53
53
  end
54
-
54
+
55
55
  should "have coverage of 0" do
56
56
  assert_equal 0, @line.coverage
57
57
  end
58
-
58
+
59
59
  should "not be covered?" do
60
60
  assert !@line.covered?
61
61
  end
62
-
62
+
63
63
  should "not be never?" do
64
64
  assert !@line.never?
65
65
  end
66
-
66
+
67
67
  should "be missed?" do
68
68
  assert @line.missed?
69
69
  end
70
70
  end
71
-
71
+
72
72
  context "A source line with no code" do
73
73
  setup do
74
74
  @line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, nil)
75
75
  end
76
-
76
+
77
77
  should "have nil coverage" do
78
78
  assert_nil @line.coverage
79
79
  end
80
-
80
+
81
81
  should "not be covered?" do
82
82
  assert !@line.covered?
83
83
  end
84
-
84
+
85
85
  should "be never?" do
86
86
  assert @line.never?
87
87
  end
88
-
88
+
89
89
  should "not be missed?" do
90
90
  assert !@line.missed?
91
91
  end
92
92
  end
93
-
93
+
94
94
  should "raise ArgumentError when initialized with invalid src" do
95
95
  assert_raise ArgumentError do
96
96
  SimpleCov::SourceFile::Line.new(:symbol, 5, 3)
97
97
  end
98
98
  end
99
-
99
+
100
100
  should "raise ArgumentError when initialized with invalid line_number" do
101
101
  assert_raise ArgumentError do
102
102
  SimpleCov::SourceFile::Line.new("some source", "five", 3)
103
103
  end
104
104
  end
105
-
105
+
106
106
  should "raise ArgumentError when initialized with invalid coverage" do
107
107
  assert_raise ArgumentError do
108
108
  SimpleCov::SourceFile::Line.new("some source", 5, "three")
metadata CHANGED
@@ -1,72 +1,151 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: simplecov
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.2
4
5
  prerelease:
5
- version: 0.4.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Christoph Olszowka
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-04-02 00:00:00 +02:00
12
+ date: 2011-09-12 00:00:00.000000000 +02:00
14
13
  default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: simplecov-html
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: multi_json
17
+ requirement: &70325095065400 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.3
23
+ type: :runtime
18
24
  prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
25
+ version_requirements: *70325095065400
26
+ - !ruby/object:Gem::Dependency
27
+ name: simplecov-html
28
+ requirement: &70325095064900 !ruby/object:Gem::Requirement
20
29
  none: false
21
- requirements:
30
+ requirements:
22
31
  - - ~>
23
- - !ruby/object:Gem::Version
24
- version: 0.4.4
32
+ - !ruby/object:Gem::Version
33
+ version: 0.5.0
25
34
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: shoulda
29
35
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
36
+ version_requirements: *70325095064900
37
+ - !ruby/object:Gem::Dependency
38
+ name: aruba
39
+ requirement: &70325095064440 !ruby/object:Gem::Requirement
31
40
  none: false
32
- requirements:
33
- - - "="
34
- - !ruby/object:Gem::Version
35
- version: 2.10.3
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: '0.4'
36
45
  type: :development
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
46
+ prerelease: false
47
+ version_requirements: *70325095064440
48
+ - !ruby/object:Gem::Dependency
49
+ name: capybara
50
+ requirement: &70325095063980 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '1.0'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *70325095063980
59
+ - !ruby/object:Gem::Dependency
60
+ name: cucumber
61
+ requirement: &70325095063520 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ~>
65
+ - !ruby/object:Gem::Version
66
+ version: '1.0'
67
+ type: :development
68
+ prerelease: false
69
+ version_requirements: *70325095063520
70
+ - !ruby/object:Gem::Dependency
71
+ name: rake
72
+ requirement: &70325095063060 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '0.8'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: *70325095063060
81
+ - !ruby/object:Gem::Dependency
39
82
  name: rspec
83
+ requirement: &70325095062600 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ version: '2.6'
89
+ type: :development
40
90
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
91
+ version_requirements: *70325095062600
92
+ - !ruby/object:Gem::Dependency
93
+ name: shoulda
94
+ requirement: &70325095062140 !ruby/object:Gem::Requirement
42
95
  none: false
43
- requirements:
96
+ requirements:
44
97
  - - ~>
45
- - !ruby/object:Gem::Version
46
- version: 2.0.0
98
+ - !ruby/object:Gem::Version
99
+ version: '2.10'
47
100
  type: :development
48
- version_requirements: *id003
49
- description: Code coverage for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites
50
- email:
101
+ prerelease: false
102
+ version_requirements: *70325095062140
103
+ description: Code coverage for Ruby 1.9 with a powerful configuration library and
104
+ automatic merging of coverage across test suites
105
+ email:
51
106
  - christoph at olszowka de
52
107
  executables: []
53
-
54
108
  extensions: []
55
-
56
109
  extra_rdoc_files: []
57
-
58
- files:
59
- - .document
110
+ files:
60
111
  - .gitignore
61
112
  - .rvmrc
113
+ - .travis.yml
114
+ - CHANGELOG.md
62
115
  - Gemfile
63
116
  - LICENSE
64
117
  - README.rdoc
65
118
  - Rakefile
119
+ - cucumber.yml
120
+ - features/config_adapters.feature
121
+ - features/config_autoload.feature
122
+ - features/config_command_name.feature
123
+ - features/config_coverage_dir.feature
124
+ - features/config_deactivate_merging.feature
125
+ - features/config_merge_timeout.feature
126
+ - features/config_project_name.feature
127
+ - features/config_styles.feature
128
+ - features/cucumber_basic.feature
129
+ - features/merging_test_unit_and_rspec.feature
130
+ - features/rspec_basic.feature
131
+ - features/rspec_groups_and_filters_basic.feature
132
+ - features/rspec_groups_and_filters_complex.feature
133
+ - features/rspec_without_simplecov.feature
134
+ - features/step_definitions/html_steps.rb
135
+ - features/step_definitions/simplecov_steps.rb
136
+ - features/step_definitions/transformers.rb
137
+ - features/step_definitions/web_steps.rb
138
+ - features/support/env.rb
139
+ - features/test_unit_basic.feature
140
+ - features/test_unit_groups_and_filters_basic.feature
141
+ - features/test_unit_groups_and_filters_complex.feature
142
+ - features/test_unit_without_simplecov.feature
66
143
  - lib/simplecov.rb
67
144
  - lib/simplecov/adapters.rb
68
145
  - lib/simplecov/command_guesser.rb
69
146
  - lib/simplecov/configuration.rb
147
+ - lib/simplecov/defaults.rb
148
+ - lib/simplecov/file_list.rb
70
149
  - lib/simplecov/filter.rb
71
150
  - lib/simplecov/formatter.rb
72
151
  - lib/simplecov/formatter/simple_formatter.rb
@@ -77,6 +156,24 @@ files:
77
156
  - lib/simplecov/source_file.rb
78
157
  - lib/simplecov/version.rb
79
158
  - simplecov.gemspec
159
+ - test/faked_project/Gemfile
160
+ - test/faked_project/Rakefile
161
+ - test/faked_project/cucumber.yml
162
+ - test/faked_project/features/step_definitions/my_steps.rb
163
+ - test/faked_project/features/support/env.rb
164
+ - test/faked_project/features/test_stuff.feature
165
+ - test/faked_project/lib/faked_project.rb
166
+ - test/faked_project/lib/faked_project/framework_specific.rb
167
+ - test/faked_project/lib/faked_project/meta_magic.rb
168
+ - test/faked_project/lib/faked_project/some_class.rb
169
+ - test/faked_project/spec/faked_spec.rb
170
+ - test/faked_project/spec/meta_magic_spec.rb
171
+ - test/faked_project/spec/some_class_spec.rb
172
+ - test/faked_project/spec/spec_helper.rb
173
+ - test/faked_project/test/faked_test.rb
174
+ - test/faked_project/test/meta_magic_test.rb
175
+ - test/faked_project/test/some_class_test.rb
176
+ - test/faked_project/test/test_helper.rb
80
177
  - test/fixtures/app/controllers/sample_controller.rb
81
178
  - test/fixtures/app/models/user.rb
82
179
  - test/fixtures/deleted_source_sample.rb
@@ -92,6 +189,7 @@ files:
92
189
  - test/test_1_8_fallbacks.rb
93
190
  - test/test_command_guesser.rb
94
191
  - test/test_deleted_source.rb
192
+ - test/test_file_list.rb
95
193
  - test/test_filters.rb
96
194
  - test/test_merge_helpers.rb
97
195
  - test/test_result.rb
@@ -101,32 +199,71 @@ files:
101
199
  has_rdoc: true
102
200
  homepage: http://github.com/colszowka/simplecov
103
201
  licenses: []
104
-
105
202
  post_install_message:
106
203
  rdoc_options: []
107
-
108
- require_paths:
204
+ require_paths:
109
205
  - lib
110
- required_ruby_version: !ruby/object:Gem::Requirement
206
+ required_ruby_version: !ruby/object:Gem::Requirement
111
207
  none: false
112
- requirements:
113
- - - ">="
114
- - !ruby/object:Gem::Version
115
- version: "0"
116
- required_rubygems_version: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - ! '>='
210
+ - !ruby/object:Gem::Version
211
+ version: '0'
212
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
213
  none: false
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- version: "0"
214
+ requirements:
215
+ - - ! '>='
216
+ - !ruby/object:Gem::Version
217
+ version: '0'
122
218
  requirements: []
123
-
124
- rubyforge_project: simplecov
125
- rubygems_version: 1.6.1
219
+ rubyforge_project:
220
+ rubygems_version: 1.6.2
126
221
  signing_key:
127
222
  specification_version: 3
128
- summary: Code coverage for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites
129
- test_files:
223
+ summary: Code coverage for Ruby 1.9 with a powerful configuration library and automatic
224
+ merging of coverage across test suites
225
+ test_files:
226
+ - features/config_adapters.feature
227
+ - features/config_autoload.feature
228
+ - features/config_command_name.feature
229
+ - features/config_coverage_dir.feature
230
+ - features/config_deactivate_merging.feature
231
+ - features/config_merge_timeout.feature
232
+ - features/config_project_name.feature
233
+ - features/config_styles.feature
234
+ - features/cucumber_basic.feature
235
+ - features/merging_test_unit_and_rspec.feature
236
+ - features/rspec_basic.feature
237
+ - features/rspec_groups_and_filters_basic.feature
238
+ - features/rspec_groups_and_filters_complex.feature
239
+ - features/rspec_without_simplecov.feature
240
+ - features/step_definitions/html_steps.rb
241
+ - features/step_definitions/simplecov_steps.rb
242
+ - features/step_definitions/transformers.rb
243
+ - features/step_definitions/web_steps.rb
244
+ - features/support/env.rb
245
+ - features/test_unit_basic.feature
246
+ - features/test_unit_groups_and_filters_basic.feature
247
+ - features/test_unit_groups_and_filters_complex.feature
248
+ - features/test_unit_without_simplecov.feature
249
+ - test/faked_project/Gemfile
250
+ - test/faked_project/Rakefile
251
+ - test/faked_project/cucumber.yml
252
+ - test/faked_project/features/step_definitions/my_steps.rb
253
+ - test/faked_project/features/support/env.rb
254
+ - test/faked_project/features/test_stuff.feature
255
+ - test/faked_project/lib/faked_project.rb
256
+ - test/faked_project/lib/faked_project/framework_specific.rb
257
+ - test/faked_project/lib/faked_project/meta_magic.rb
258
+ - test/faked_project/lib/faked_project/some_class.rb
259
+ - test/faked_project/spec/faked_spec.rb
260
+ - test/faked_project/spec/meta_magic_spec.rb
261
+ - test/faked_project/spec/some_class_spec.rb
262
+ - test/faked_project/spec/spec_helper.rb
263
+ - test/faked_project/test/faked_test.rb
264
+ - test/faked_project/test/meta_magic_test.rb
265
+ - test/faked_project/test/some_class_test.rb
266
+ - test/faked_project/test/test_helper.rb
130
267
  - test/fixtures/app/controllers/sample_controller.rb
131
268
  - test/fixtures/app/models/user.rb
132
269
  - test/fixtures/deleted_source_sample.rb
@@ -142,6 +279,7 @@ test_files:
142
279
  - test/test_1_8_fallbacks.rb
143
280
  - test/test_command_guesser.rb
144
281
  - test/test_deleted_source.rb
282
+ - test/test_file_list.rb
145
283
  - test/test_filters.rb
146
284
  - test/test_merge_helpers.rb
147
285
  - test/test_result.rb
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE