# Newbie Problem : Including gems in Rake::TestTask

**URL:** <https://www.ruby-forum.com/t/newbie-problem-including-gems-in-rake-testtask/129133>\
**Category:** Ruby\
**Created:** [February 14, 2008, 6:36pm UTC](https://www.ruby-forum.com/t/newbie-problem-including-gems-in-rake-testtask/129133 "2008-02-14T18:36:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@michaelb](https://www.ruby-forum.com/u/michaelb)\
**Post date:** [February 14, 2008, 6:36pm UTC](https://www.ruby-forum.com/t/newbie-problem-including-gems-in-rake-testtask/129133/1 "2008-02-14T18:36:45Z")

</div>

I’d like to include spec behaviour testing behaviour in the  
Rake::TestTask, however I am unable to do this. At the moment, my code  
looks like this.

require ‘rake’  
require ‘rake/testtask’

require ‘3rd\_party/bacon/lib/bacon.rb’

desc(‘Runs all tests in the subdirectories of lib’)  
task :test do  
Rake::TestTask.new do |t|  
t.pattern = ‘lib/\*\*/test/test\_\*.rb’  
end  
end

However the line " require ‘3rd\_party/bacon/lib/bacon.rb’ " has no  
effect and instead I have to include it in all my testing files - which  
is not very DRY. I’m not using ruby\_gems because I’d like to distribute  
my code, and I don’t want other people to have to install dependencies  
to run it. I’ve tried different variations of using t.libs TestTask  
block however this hasn’t solved the problem either.

Any help would be appreciated.

Mike
