Newbie Problem : Including gems in Rake::TestTask

M

Michael Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top