Here’s a link to Rake::TestTask.
There is an example in the page to get you started.
I’ll post another one that I’m using right now for a gem:
require 'rake/testtask'
Rake::TestTask.new do |t|
t.pattern = "spec/*_spec.rb"
end
As you can see, I assume that my files are all in /lib
and that my specs are in /spec
and are named whatever_spec.rb