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