simplecov 0.7.1 → 0.8.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/.travis.yml +9 -2
  2. data/CHANGELOG.md +17 -2
  3. data/Gemfile +13 -2
  4. data/{LICENSE → MIT-LICENSE} +0 -0
  5. data/README.md +174 -117
  6. data/Rakefile +8 -3
  7. data/features/config_command_name.feature +12 -0
  8. data/features/config_merge_timeout.feature +3 -3
  9. data/features/config_profiles.feature +44 -0
  10. data/features/config_project_name.feature +2 -2
  11. data/features/cucumber_basic.feature +1 -1
  12. data/features/step_definitions/html_steps.rb +1 -1
  13. data/features/support/env.rb +23 -5
  14. data/gemfiles/multi_json_legacy.gemfile +12 -0
  15. data/gemfiles/multi_json_new.gemfile +12 -0
  16. data/lib/simplecov.rb +33 -25
  17. data/lib/simplecov/command_guesser.rb +6 -6
  18. data/lib/simplecov/configuration.rb +7 -2
  19. data/lib/simplecov/defaults.rb +9 -5
  20. data/lib/simplecov/file_list.rb +1 -1
  21. data/lib/simplecov/jruby16_fix.rb +43 -0
  22. data/lib/simplecov/no_defaults.rb +2 -0
  23. data/lib/simplecov/{adapters.rb → profiles.rb} +8 -8
  24. data/lib/simplecov/result.rb +10 -2
  25. data/lib/simplecov/source_file.rb +2 -3
  26. data/lib/simplecov/version.rb +1 -1
  27. data/simplecov.gemspec +8 -9
  28. data/test/faked_project/Gemfile +1 -1
  29. data/test/helper.rb +0 -1
  30. data/test/shoulda_macros.rb +0 -10
  31. data/test/test_1_8_fallbacks.rb +16 -18
  32. data/test/test_command_guesser.rb +13 -15
  33. data/test/test_deleted_source.rb +5 -7
  34. data/test/test_file_list.rb +15 -17
  35. data/test/test_filters.rb +56 -58
  36. data/test/test_merge_helpers.rb +73 -75
  37. data/test/test_result.rb +114 -116
  38. data/test/test_return_codes.rb +24 -26
  39. data/test/test_source_file.rb +75 -64
  40. data/test/test_source_file_line.rb +78 -82
  41. metadata +38 -86
  42. data/features/config_adapters.feature +0 -44
  43. data/gemfiles/multi_json-legacy.gemfile +0 -7
  44. data/gemfiles/multi_json-new.gemfile +0 -7
data/.travis.yml CHANGED
@@ -5,16 +5,23 @@ script:
5
5
  - rake appraisal:install
6
6
  - rake appraisal
7
7
  rvm:
8
+ - ree
8
9
  - 1.8.7
9
10
  - 1.9.2
10
11
  - 1.9.3
11
- - ruby-head
12
- - ree
12
+ - 2.0.0
13
13
  - rbx-18mode
14
+ - rbx-19mode
14
15
  - jruby-18mode
16
+ - jruby-19mode
17
+ - jruby-head
18
+ - ruby-head
15
19
  matrix:
16
20
  allow_failures:
17
21
  - rvm: ruby-head
22
+ - rvm: jruby-head
23
+ - rvm: jruby-19mode
24
+ - rvm: rbx-19mode
18
25
  notifications:
19
26
  email:
20
27
  on_success: always
data/CHANGELOG.md CHANGED
@@ -1,6 +1,21 @@
1
- Unreleased ([changes](https://github.com/colszowka/simplecov/compare/v0.7.0...master))
1
+ Unreleased ([changes](https://github.com/colszowka/simplecov/compare/v0.7.1...master))
2
2
  -------------------
3
3
 
4
+ * [FEATURE] Adds support for Rails 4 command guessing.
5
+ See [#181](https://github.com/colszowka/simplecov/pull/181) (thanks to @semanticart)
6
+ * [REFACTORING] Rename adapters to "profiles" given that they are bundles of settings. The old adapter methods are
7
+ deprecated, but remain available for now.
8
+ See [#207](https://github.com/colszowka/simplecov/pull/207) (thanks to @mikerobe)
9
+ * [FEATURE] You can now load simplecov without the default settings by doing `require 'simplecov/no_defaults'
10
+ or setting `ENV['SIMPLECOV_NO_DEFAULTS']`. Check `simplecov/defaults` to see what preconfigurations are getting
11
+ dropped by using this.
12
+ See [#209](https://github.com/colszowka/simplecov/pull/209) (thanks to @ileitch)
13
+ * [REFACTORING] Tweaks to the automatic test suite naming. In particular, `rspec/features` should now
14
+ be correctly attributed to RSpec, not Cucumber.
15
+ See [#212](https://github.com/colszowka/simplecov/pull/212) (thanks to @ersatzryan and @betelgeuse)
16
+ * [REFACTORING] The internal cucumber test suite now uses Capybara 2.
17
+ See [#206](https://github.com/colszowka/simplecov/pull/206) (thanks to @infertux)
18
+
4
19
  v0.7.1, 2012-10-12 ([changes](https://github.com/colszowka/simplecov/compare/v0.7.0...v0.7.1))
5
20
  -------------------
6
21
 
@@ -170,4 +185,4 @@ v0.5.0, 2011-09-09 ([changes](https://github.com/colszowka/simplecov/compare/v0.
170
185
  * The display of source files has been improved a lot. Weird scrolling trouble, out-of-scope line hit counts
171
186
  and such should be a thing of the past. Also, it is prettier now.
172
187
  * Source files are now syntax highlighted
173
- * File paths no longer have that annoying './' in front of them
188
+ * File paths no longer have that annoying './' in front of them
data/Gemfile CHANGED
@@ -1,5 +1,16 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
  gemspec
3
3
 
4
+ if 'Integration test (cucumber) suite is 1.9+ only'.respond_to? :encoding
5
+ gem 'aruba', '~> 0.5.1'
6
+ gem 'capybara', '~> 2.0'
7
+ gem 'poltergeist', '~> 1.1.0'
8
+ gem 'phantomjs', '~> 1.8.1'
9
+ gem 'cucumber', '>= 1.1.0'
10
+ end
11
+
4
12
  # Uncomment this to use local copy of simplecov-html in development when checked out
5
- # gem 'simplecov-html', :path => File.dirname(__FILE__) + '/../simplecov-html'
13
+ # gem 'simplecov-html', :path => ::File.dirname(__FILE__) + '/../simplecov-html'
14
+
15
+ # Uncomment this to use development version of html formatter from github
16
+ # gem 'simplecov-html', :github => 'colszowka/simplecov-html'
File without changes
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- SimpleCov [![Build Status](https://secure.travis-ci.org/colszowka/simplecov.png)][Continuous Integration] [![Dependency Status](https://gemnasium.com/colszowka/simplecov.png)][Dependencies]
1
+ SimpleCov [![Build Status](https://secure.travis-ci.org/colszowka/simplecov.png)][Continuous Integration] [![Dependency Status](https://gemnasium.com/colszowka/simplecov.png)][Dependencies] [![Code Climate](https://codeclimate.com/github/colszowka/simplecov.png)](https://codeclimate.com/github/colszowka/simplecov)
2
2
  =========
3
3
  **Code coverage for Ruby 1.9**
4
4
 
@@ -6,6 +6,7 @@ SimpleCov [![Build Status](https://secure.travis-ci.org/colszowka/simplecov.png)
6
6
  * [API documentation]
7
7
  * [Changelog]
8
8
  * [Rubygem]
9
+ * [Mailing List]
9
10
  * [Continuous Integration]
10
11
 
11
12
  [Coverage]: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/coverage/rdoc/Coverage.html "API doc for Ruby 1.9's Coverage library"
@@ -17,6 +18,7 @@ SimpleCov [![Build Status](https://secure.travis-ci.org/colszowka/simplecov.png)
17
18
  [Continuous Integration]: http://travis-ci.org/colszowka/simplecov "SimpleCov is built around the clock by travis-ci.org"
18
19
  [Dependencies]: https://gemnasium.com/colszowka/simplecov "SimpleCov dependencies on Gemnasium"
19
20
  [simplecov-html]: https://github.com/colszowka/simplecov-html "SimpleCov HTML Formatter Source Code @ GitHub"
21
+ [Mailing List]: https://groups.google.com/forum/#!forum/simplecov "Open mailing list for discussion and announcements on Google Groups"
20
22
  [Pledgie]: http://www.pledgie.com/campaigns/18379
21
23
 
22
24
  [![You can support the development of SimpleCov via Pledgie - thanks for your help](http://www.pledgie.com/campaigns/18379.png?skin_name=chrome)][Pledgie]
@@ -40,43 +42,51 @@ Getting started
40
42
 
41
43
  1. Add SimpleCov to your `Gemfile` and `bundle install`:
42
44
 
43
- gem 'simplecov', :require => false, :group => :test
45
+ ```ruby
46
+ gem 'simplecov', :require => false, :group => :test
47
+ ```
44
48
 
45
49
  2. Load and launch SimpleCov **at the very top** of your `test/test_helper.rb` (*or `spec_helper.rb`, cucumber `env.rb`, or whatever
46
50
  your preferred test framework uses*):
47
51
 
48
- require 'simplecov'
49
- SimpleCov.start
52
+ ```ruby
53
+ require 'simplecov'
54
+ SimpleCov.start
50
55
 
51
- # Previous content of test helper now starts here
56
+ # Previous content of test helper now starts here
57
+ ```
52
58
 
53
- **Note:** If SimpleCov starts after your application code is already loaded (via `require`), it won't be able to
54
- track your files and their coverage! The `SimpleCov.start` **must** be issued **before any of your application code
55
- is required!**
59
+ **Note:** If SimpleCov starts after your application code is already loaded (via `require`), it won't be able to
60
+ track your files and their coverage! The `SimpleCov.start` **must** be issued **before any of your application code
61
+ is required!**
56
62
 
57
- SimpleCov must be running in the process that you want the code coverage analysis to happen on. When testing a server
58
- process (i.e. a JSON API endpoint) via a separate test process (i.e. when using Selenium) where you want to see all
59
- code executed by the `rails server`, and not just code executed in your actual test files, you'll want to add something
60
- like this to the top of `script/rails`:
63
+ SimpleCov must be running in the process that you want the code coverage analysis to happen on. When testing a server
64
+ process (i.e. a JSON API endpoint) via a separate test process (i.e. when using Selenium) where you want to see all
65
+ code executed by the `rails server`, and not just code executed in your actual test files, you'll want to add something
66
+ like this to the top of `script/rails`:
61
67
 
62
- if ENV['RAILS_ENV'] == 'test'
63
- require 'simplecov'
64
- SimpleCov.start 'rails'
65
- puts "required simplecov"
66
- end
68
+ ```ruby
69
+ if ENV['RAILS_ENV'] == 'test'
70
+ require 'simplecov'
71
+ SimpleCov.start 'rails'
72
+ puts "required simplecov"
73
+ end
74
+ ```
67
75
 
68
76
  3. Run your tests, open up `coverage/index.html` in your browser and check out what you've missed so far.
69
77
 
70
78
  4. Add the following to your `.gitignore` file to ensure that coverage results are not tracked by Git (optional):
71
79
 
72
- coverage
80
+ coverage
73
81
 
74
- If you're making a Rails application, SimpleCov comes with a built-in adapter (see below for more information on what adapters are)
82
+ If you're making a Rails application, SimpleCov comes with a built-in configurations (see below for information on profiles)
75
83
  which will get you started with groups for your Controllers, Views, Models and Helpers. To use it, the first two lines of
76
84
  your test_helper should be like this:
77
85
 
78
- require 'simplecov'
79
- SimpleCov.start 'rails'
86
+ ```ruby
87
+ require 'simplecov'
88
+ SimpleCov.start 'rails'
89
+ ```
80
90
 
81
91
  ## Example output
82
92
 
@@ -99,8 +109,10 @@ config to the very top of your Cucumber/RSpec/whatever setup file.
99
109
  Add the setup code to the **top** of `features/support/env.rb` (for Cucumber) or `spec/spec_helper.rb` (for RSpec).
100
110
  Other test frameworks should work accordingly, whatever their setup file may be:
101
111
 
102
- require 'simplecov'
103
- SimpleCov.start 'rails'
112
+ ```ruby
113
+ require 'simplecov'
114
+ SimpleCov.start 'rails'
115
+ ```
104
116
 
105
117
  You could even track what kind of code your UI testers are touching if you want to go overboard with things. SimpleCov does not
106
118
  care what kind of framework it is running in, it just looks at what code is being executed and generates a report about it.
@@ -182,19 +194,25 @@ to use SimpleCov with them. Here's an overview of the known ones:
182
194
 
183
195
  * The most common way is to configure it directly in your start block:
184
196
 
185
- SimpleCov.start do
186
- some_config_option 'foo'
187
- end
197
+ ```ruby
198
+ SimpleCov.start do
199
+ some_config_option 'foo'
200
+ end
201
+ ```
188
202
 
189
203
  * You can also set all configuration options directly:
190
204
 
191
- SimpleCov.some_config_option 'foo'
205
+ ```ruby
206
+ SimpleCov.some_config_option 'foo'
207
+ ```
192
208
 
193
209
  * If you do not want to start coverage immediately after launch or want to add additional configuration later on in a concise way, use:
194
210
 
195
- SimpleCov.configure do
196
- some_config_option 'foo'
197
- end
211
+ ```ruby
212
+ SimpleCov.configure do
213
+ some_config_option 'foo'
214
+ end
215
+ ```
198
216
 
199
217
  Please check out the [Configuration] API documentation to find out what you can customize.
200
218
 
@@ -207,17 +225,18 @@ set up all your config options twice, once in `test_helper.rb` and once in `env.
207
225
  To avoid this, you can place a file called `.simplecov` in your project root. You can then just leave the `require 'simplecov'` in each
208
226
  test setup helper and move the `SimpleCov.start` code with all your custom config options into `.simplecov`:
209
227
 
210
- # test/test_helper.rb
211
- require 'simplecov'
228
+ ```ruby
229
+ # test/test_helper.rb
230
+ require 'simplecov'
212
231
 
213
- # features/support/env.rb
214
- require 'simplecov'
215
-
216
- # .simplecov
217
- SimpleCov.start 'rails' do
218
- # any custom configs like groups and filters can be here at a central place
219
- end
232
+ # features/support/env.rb
233
+ require 'simplecov'
220
234
 
235
+ # .simplecov
236
+ SimpleCov.start 'rails' do
237
+ # any custom configs like groups and filters can be here at a central place
238
+ end
239
+ ```
221
240
 
222
241
  ## Filters
223
242
 
@@ -235,19 +254,23 @@ a block or by passing in your own Filter class.
235
254
 
236
255
  #### String filter
237
256
 
238
- SimpleCov.start do
239
- add_filter "/test/"
240
- end
257
+ ```ruby
258
+ SimpleCov.start do
259
+ add_filter "/test/"
260
+ end
261
+ ```
241
262
 
242
263
  This simple string filter will remove all files that match "/test/" in their path.
243
264
 
244
265
  #### Block filter
245
266
 
246
- SimpleCov.start do
247
- add_filter do |source_file|
248
- source_file.lines.count < 5
249
- end
250
- end
267
+ ```ruby
268
+ SimpleCov.start do
269
+ add_filter do |source_file|
270
+ source_file.lines.count < 5
271
+ end
272
+ end
273
+ ```
251
274
 
252
275
  Block filters receive a SimpleCov::SourceFile instance and expect your block to return either true (if the file is to be removed
253
276
  from the result) or false (if the result should be kept). Please check out the RDoc for SimpleCov::SourceFile to learn about the
@@ -255,13 +278,15 @@ methods available to you. In the above example, the filter will remove all files
255
278
 
256
279
  #### Custom filter class
257
280
 
258
- class LineFilter < SimpleCov::Filter
259
- def matches?(source_file)
260
- source_file.lines.count < filter_argument
261
- end
262
- end
281
+ ```ruby
282
+ class LineFilter < SimpleCov::Filter
283
+ def matches?(source_file)
284
+ source_file.lines.count < filter_argument
285
+ end
286
+ end
263
287
 
264
- SimpleCov.add_filter LineFilter.new(5)
288
+ SimpleCov.add_filter LineFilter.new(5)
289
+ ```
265
290
 
266
291
  Defining your own filters is pretty easy: Just inherit from SimpleCov::Filter and define a method 'matches?(source_file)'. When running
267
292
  the filter, a true return value from this method will result in the removal of the given source_file. The filter_argument method
@@ -277,14 +302,16 @@ which exclude files from results when the filter results in a true value.
277
302
 
278
303
  Add your groups with:
279
304
 
280
- SimpleCov.start do
281
- add_group "Models", "app/models"
282
- add_group "Controllers", "app/controllers"
283
- add_group "Long files" do |src_file|
284
- src_file.lines.count > 100
285
- end
286
- add_group "Short files", LineFilter.new(5) # Using the LineFilter class defined in Filters section above
287
- end
305
+ ```ruby
306
+ SimpleCov.start do
307
+ add_group "Models", "app/models"
308
+ add_group "Controllers", "app/controllers"
309
+ add_group "Long files" do |src_file|
310
+ src_file.lines.count > 100
311
+ end
312
+ add_group "Short files", LineFilter.new(5) # Using the LineFilter class defined in Filters section above
313
+ end
314
+ ```
288
315
 
289
316
  ## Merging results
290
317
 
@@ -311,17 +338,19 @@ So, to customize the suite names on a Rails app (yeah, sorry for being Rails bia
311
338
  the structure of those projects is. You can apply this accordingly to the RSpecs in your Outlook-WebDAV-Calendar-Sync gem),
312
339
  you could do something like this:
313
340
 
314
- # test/unit/some_test.rb
315
- SimpleCov.command_name 'test:units'
341
+ ```ruby
342
+ # test/unit/some_test.rb
343
+ SimpleCov.command_name 'test:units'
316
344
 
317
- # test/functionals/some_controller_test.rb
318
- SimpleCov.command_name "test:functionals"
345
+ # test/functionals/some_controller_test.rb
346
+ SimpleCov.command_name "test:functionals"
319
347
 
320
- # test/integration/some_integration_test.rb
321
- SimpleCov.command_name "test:integration"
348
+ # test/integration/some_integration_test.rb
349
+ SimpleCov.command_name "test:integration"
322
350
 
323
- # features/support/env.rb
324
- SimpleCov.command_name "features"
351
+ # features/support/env.rb
352
+ SimpleCov.command_name "features"
353
+ ```
325
354
 
326
355
  Note that this has only to be invoked ONCE PER TEST SUITE, so even if you have 200 unit test files, specifying it in
327
356
  some_test.rb is fair enough.
@@ -348,72 +377,85 @@ Because of this, SimpleCov has no explicit built-in mechanism to run coverage on
348
377
 
349
378
  However, you can still accomplish this very easily by introducing a ENV variable conditional into your SimpleCov setup block, like this:
350
379
 
351
- SimpleCov.start if ENV["COVERAGE"]
380
+ ```ruby
381
+ SimpleCov.start if ENV["COVERAGE"]
382
+ ```
352
383
 
353
384
  Then, SimpleCov will only run if you execute your tests like this:
354
385
 
355
- $ COVERAGE=true rake test
386
+ ```shell
387
+ COVERAGE=true rake test
388
+ ```
356
389
 
357
390
 
358
- ## Adapters
391
+ ## Profiles
359
392
 
360
393
  By default, Simplecov's only config assumption is that you only want coverage reports for files inside your project
361
- root. To save you from repetitive configuration, you can use predefined blocks of configuration, called 'adapters',
394
+ root. To save you from repetitive configuration, you can use predefined blocks of configuration, called 'profiles',
362
395
  or define your own.
363
396
 
364
- You can then pass the name of the adapter to be used as the first argument to SimpleCov.start. For example, simplecov
365
- comes bundled with a 'rails' adapter. It looks somewhat like this:
397
+ You can then pass the name of the profile to be used as the first argument to SimpleCov.start. For example, simplecov
398
+ comes bundled with a 'rails' profile. It looks somewhat like this:
366
399
 
367
- SimpleCov.adapters.define 'rails' do
368
- add_filter '/test/'
369
- add_filter '/config/'
400
+ ```ruby
401
+ SimpleCov.profiles.define 'rails' do
402
+ add_filter '/test/'
403
+ add_filter '/config/'
370
404
 
371
- add_group 'Controllers', 'app/controllers'
372
- add_group 'Models', 'app/models'
373
- add_group 'Helpers', 'app/helpers'
374
- add_group 'Libraries', 'lib'
375
- add_group 'Plugins', 'vendor/plugins'
376
- end
405
+ add_group 'Controllers', 'app/controllers'
406
+ add_group 'Models', 'app/models'
407
+ add_group 'Helpers', 'app/helpers'
408
+ add_group 'Libraries', 'lib'
409
+ add_group 'Plugins', 'vendor/plugins'
410
+ end
411
+ ```
377
412
 
378
- As you can see, it's just a glorified SimpleCov.configure block. In your test_helper.rb, launch simplecov with:
413
+ As you can see, it's just a SimpleCov.configure block. In your test_helper.rb, launch simplecov with:
379
414
 
380
- SimpleCov.start 'rails'
415
+ ```ruby
416
+ SimpleCov.start 'rails'
417
+ ```
381
418
 
382
419
  **OR**
383
420
 
384
- SimpleCov.start 'rails' do
385
- # additional config here
386
- end
387
-
388
- ### Custom adapters
421
+ ```ruby
422
+ SimpleCov.start 'rails' do
423
+ # additional config here
424
+ end
425
+ ```
389
426
 
390
- You can load additional adapters with the SimpleCov.load_adapter('xyz') method. This allows you to build upon an existing
391
- adapter and customize it so you can reuse it in unit tests and cucumber features, for example.
427
+ ### Custom profiles
392
428
 
393
- # lib/simplecov_custom_adapter.rb
394
- require 'simplecov'
395
- SimpleCov.adapters.define 'myadapter' do
396
- load_adapter 'rails'
397
- add_filter 'vendor' # Don't include vendored stuff
398
- end
429
+ You can load additional profiles with the SimpleCov.load_profile('xyz') method. This allows you to build upon an existing
430
+ profile and customize it so you can reuse it in unit tests and cucumber features, for example.
399
431
 
400
- # features/support/env.rb
401
- require 'simplecov_custom_adapter'
402
- SimpleCov.start 'myadapter'
432
+ ```ruby
433
+ # lib/simplecov_custom_profile.rb
434
+ require 'simplecov'
435
+ SimpleCov.profiles.define 'myprofile' do
436
+ load_profile 'rails'
437
+ add_filter 'vendor' # Don't include vendored stuff
438
+ end
403
439
 
404
- # test/test_helper.rb
405
- require 'simplecov_custom_adapter'
406
- SimpleCov.start 'myadapter'
440
+ # features/support/env.rb
441
+ require 'simplecov_custom_profile'
442
+ SimpleCov.start 'myprofile'
407
443
 
444
+ # test/test_helper.rb
445
+ require 'simplecov_custom_profile'
446
+ SimpleCov.start 'myprofile'
447
+ ```
408
448
 
409
449
 
410
450
  ## Customizing exit behaviour
411
451
 
412
452
  You can define what simplecov should do when your test suite finishes by customizing the at_exit hook:
413
453
 
414
- SimpleCov.at_exit do
415
- SimpleCov.result.format!
416
- end
454
+ ```ruby
455
+ SimpleCov.at_exit do
456
+ SimpleCov.result.format!
457
+ end
458
+ ```
417
459
 
418
460
  Above is the default behaviour. Do whatever you like instead!
419
461
 
@@ -421,25 +463,33 @@ Above is the default behaviour. Do whatever you like instead!
421
463
 
422
464
  You can define the minimum coverage percentage expected. SimpleCov will return non-zero if unmet.
423
465
 
424
- SimpleCov.minimum_coverage 90
466
+ ```ruby
467
+ SimpleCov.minimum_coverage 90
468
+ ```
425
469
 
426
470
  ### Maximum coverage drop
427
471
 
428
472
  You can define the maximum coverage drop percentage at once. SimpleCov will return non-zero if exceeded.
429
473
 
430
- SimpleCov.maximum_coverage_drop 5
474
+ ```ruby
475
+ SimpleCov.maximum_coverage_drop 5
476
+ ```
431
477
 
432
478
  ### Refuse dropping coverage
433
479
 
434
480
  You can also entirely refuse dropping coverage between test runs:
435
481
 
436
- SimpleCov.refuse_coverage_drop
482
+ ```ruby
483
+ SimpleCov.refuse_coverage_drop
484
+ ```
437
485
 
438
486
  ## Using your own formatter
439
487
 
440
488
  You can use your own formatter with:
441
489
 
442
- SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
490
+ ```ruby
491
+ SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
492
+ ```
443
493
 
444
494
  When calling SimpleCov.result.format!, it will be invoked with SimpleCov::Formatter::YourFormatter.new.format(result), "result"
445
495
  being an instance of SimpleCov::Result. Do whatever your wish with that!
@@ -449,10 +499,12 @@ being an instance of SimpleCov::Result. Do whatever your wish with that!
449
499
 
450
500
  If you want to use multiple result formats, as of SimpleCov 0.7.0 you can use the built-in MultiFormatter:
451
501
 
452
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
453
- SimpleCov::Formatter::HTMLFormatter,
454
- SimpleCov::Formatter::CSVFormatter,
455
- ]
502
+ ```ruby
503
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
504
+ SimpleCov::Formatter::HTMLFormatter,
505
+ SimpleCov::Formatter::CSVFormatter,
506
+ ]
507
+ ```
456
508
 
457
509
  ## Available formatters
458
510
 
@@ -474,6 +526,11 @@ CSV formatter for SimpleCov code coverage tool for ruby 1.9+
474
526
 
475
527
  A formatter for Simplecov that emits a Vim script to mark up code files with coverage information.
476
528
 
529
+ #### [simplecov-single_file_reporter](https://github.com/grosser/simplecov-single_file_reporter)
530
+ *by [Michael Grosser](http://grosser.it)*
531
+
532
+ A formatter that prints the coverage of the file under test when you run a single test file.
533
+
477
534
  ## Ruby version compatibility
478
535
 
479
536
  [![Build Status](https://secure.travis-ci.org/colszowka/simplecov.png)](http://travis-ci.org/colszowka/simplecov)
@@ -495,4 +552,4 @@ Thanks to Aaron Patterson for the original idea for this!
495
552
 
496
553
  ## Copyright
497
554
 
498
- Copyright (c) 2010-2012 Christoph Olszowka. See LICENSE for details.
555
+ Copyright (c) 2010-2012 Christoph Olszowka. See MIT-LICENSE for details.