Code coverage of a rails plugin

Guys

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.

<vendor/plugins/shared_models/tasks/rcov.rake>
require 'rcov/rcovtask'

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

"#{File.dirname(__FILE__)}/../test/unit/*_test.rb"]
      t.output_dir = "#{File.dirname(__FILE__)}/../test/coverage"
      t.verbose = true
    end
  end
end
</vendor/plugins/shared_models/tasks/rcov.rake>

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
"./vendor/plugins/shared_models/tasks/../test/coverage"
"./vendor/plugins/shared_models/tasks/../test/test_helper.rb"
"./vendor/plugins/shared_models/tasks/../test/shared_models_test.rb"
"./vendor/plugins/shared_models/tasks/../test/unit/resource_test.rb"
Loaded suite /usr/bin/rcov
Started
..
Finished in 0.023935 seconds.

2 tests, 2 assertions, 0 failures, 0 errors