# Can't get rcov to work. 0 assertions returned

**URL:** <https://www.ruby-forum.com/t/cant-get-rcov-to-work-0-assertions-returned/174475>\
**Category:** Rails\
**Created:** [August 27, 2009, 8:14am UTC](https://www.ruby-forum.com/t/cant-get-rcov-to-work-0-assertions-returned/174475 "2009-08-27T08:14:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![uberllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/a587f6/32.png) [@uberllama](https://www.ruby-forum.com/u/uberllama)\
**Post date:** [August 27, 2009, 8:14am UTC](https://www.ruby-forum.com/t/cant-get-rcov-to-work-0-assertions-returned/174475/1 "2009-08-27T08:14:36Z")

</div>

Hi folks. First post on these forums, after finally giving up on  
[railsforum.com](http://railsforum.com). I recently installed the relevance fork of rcov and am  
having no luck at all.

> **[GitHub - relevance/rcov: The new home of RCov on GitHub](https://github.com/relevance/rcov/tree/master)**
>
> master

```auto
sudo gem install relevance-rcov
```

Easy enough. Everything seems to have worked. I can type rcov on the  
command line and see the help file. But when I run the following  
command:

```auto
rcov test/*.rb
```

I get back 0 tests, 0 assertions, 0 failures, 0 errors. Even though I  
have plenty of tests sitting right in there. If I try running rcov  
against a specific file, such as:

```auto
rcov test/unit/user_test.rb
```

…I get the following error.

```auto
No file to analyze was found. All the files loaded by rcov matched one
of the
following expressions, and were thus ignored:
[/\A\/usr\/local\/lib/,
 /\btc_[^.]*.rb/,
 /_test\.rb\z/,
 /\btest\//,
 /\bvendor\//,
 /\A\/usr\/local\/lib\/ruby\/gems\/1\.8\/gems\/relevance\-rcov\-0\.8\.6\/lib\/rcov\/formatters\/base_formatter\.rb\z/]

You can solve this by doing one or more of the following:
* rename the files not to be ignored so they don't match the above
regexps
* use --include-file to give a list of patterns for files not to be
ignored
* use --exclude-only to give the new list of regexps to match against
* structure your code as follows:
      test/test_*.rb for the test cases
      lib/**/*.rb for the target source code whose coverage you want
  making sure that the test/test_*.rb files are loading from lib/, e.g.
by
  using the -Ilib command-line argument, adding
    $:.unshift File.join(File.dirname( __FILE__ ), "..", "lib")
  to test/test_*.rb, or running rcov via a Rakefile (read the RDoc
  documentation or README.rake in the source distribution).
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- test_helper (LoadError)
  from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
  from ./test/unit/address_test.rb:19
  from
/usr/local/lib/ruby/gems/1.8/gems/relevance-rcov-0.8.6/bin/rcov:502:in
`load'
  from
/usr/local/lib/ruby/gems/1.8/gems/relevance-rcov-0.8.6/bin/rcov:502
  from /usr/local/bin/rcov:19:in `load'
  from /usr/local/bin/rcov:19
```

Any ideas? Cheers.
