Code coverage of a rails plugin


I've been struggling with this one for a couple of hours, and nothing
seems to work here, any advice would be duly appreciated...

Background: I'm busy working on a plugin called "shared_models",
allowing you to easily share models between different applications,
running different database or on the same database. The plugin is
nearly complete, offering a generator that generates models, unit
tests, fixtures and even migrations. Some other goodies included too,
but you'll have to wait for the release :slight_smile:

Problem: I'm trying to add a rake task that will generate coverage
information for the shared_models, but I can't get this to work
properly. rcov keeps on spitting out coverage information for the
application housing the plugin.

require 'rcov/rcovtask'

namespace :shared_models do
  namespace :test do do |t|
      t.libs << "#{File.dirname(__FILE__)}/../test"
      t.test_files = FileList["#{File.dirname(__FILE__)}/../test/*.rb",

      t.output_dir = "#{File.dirname(__FILE__)}/../test/coverage"
      t.verbose = true

rcov is running, and from the debug output I can see that the correct
files are loaded inside the plugins' test, and test/unit directories.
Below is the output from running the task:

<rake shared_models:test:coverage>

rm -r ./vendor/plugins/shared_models/tasks/../test/coverage
/usr/bin/ruby18 -Ilib:./vendor/plugins/shared_models/tasks/../test -S
rcov --text-report -o
Loaded suite /usr/bin/rcov
Finished in 0.023935 seconds.

2 tests, 2 assertions, 0 failures, 0 errors