# Rails,RSpec,Rcov,Lib

**URL:** <https://www.ruby-forum.com/t/rails-rspec-rcov-lib/188303>\
**Category:** Rails\
**Created:** [May 10, 2010, 12:45am UTC](https://www.ruby-forum.com/t/rails-rspec-rcov-lib/188303 "2010-05-10T00:45:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kampers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/54ee81/32.png) [@kampers](https://www.ruby-forum.com/u/kampers)\
**Post date:** [May 10, 2010, 12:45am UTC](https://www.ruby-forum.com/t/rails-rspec-rcov-lib/188303/1 "2010-05-10T00:45:07Z")

</div>

Okay, I’ve probably just been staring at this for too long, but here is  
the problem I hope to get some help with:

I’m creating a little lib directly inside rails for integrating with  
Plesk. I’m also creating two custom rake tasks to get test and coverage  
results just on the plesk stuff. Problem is, I can’t see to find the  
right combination to get just the plesk files run with rcov. This is  
what i have so far:

Spec::Rake::SpecTask.new(‘spec:plesk:rcov’) do |t|  
files = Dir.glob(‘spec/lib/plesk/\*\*/\*\_spec.rb’)  
files \<\< ‘spec/lib/plesk\_spec.rb’  
t.spec\_files = files  
t.rcov\_opts \<\< %w{–include-file lib/plesk/,lib/plesk.rb}  
t.rcov\_opts \<\< %w{–rails --exclude app/,spec/,lib/}  
t.rcov = true  
end

Right now, I get all the lib/plesk stuff (including lib/plesk.rb, but I  
also get all the spec/lib/plesk stuff (including spec/lib/plesk.rb).

Can anyone give me just a little nudge in the right direction? How do I  
get rid of the spec files from coverage?
