What you have to do is to include the directory where your script is to the $LOAD_PATH
passing the -I
options to the ruby
command, for example if your script is some_directory/your_script.rb
, you can execute it like this:
Rake::TestTask.new do |t|
# ...
t.ruby_opts = ['-I some_directory', '-r your_script']
end