Skip to content


Xavier Nayrac edited this page · 10 revisions
Clone this wiki locally

Welcome to the coco wiki!

Configuration examples

Example 1: content of the .coco.yml file to set the threshold to 80%

:threshold: 80

Example 2: content of the .coco.yml file to set the directories to 'lib' and “ext'

- lib
- ext

Example 3: threshold to 80% and directories to 'lib' and “ext'

:threshold: 80
- lib
- ext

Example 4: to exclude some files from the report (like a black-box source generated by a parser generator), name them from the project root

- lib/project/file1.rb
- lib/project/file2.rb

Note: YAML is very punctilious with the syntax. In particular, paid attention to not put any leading spaces or tab at all.

Example 5: You can exclude a whole directory from the report:

- config/initializers

Example 6: Sometimes you don't want to see every uncovered files at every spec run. You can set the single_line_report variable as follow:

:single_line_report: true

With such a configuration, the report could look like that:

$ rake spec
26 examples, 0 failures
Some files are uncovered
Something went wrong with that request. Please try again.