I have a testing "bootstrap" Ruby script that handles test setup (requires libraries, prepares test variables etc.) and I want the Rake TestTask to run this file before it runs the tests. Is this possible?
I know that Rake starts the test in a new Ruby instance, so doing setup in the Rakefile won't work. The docs say that I can pass options to the Ruby command using TestTask.ruby_opts
, but I haven't been able to find a Ruby option that executes a script file before the main script. I did find:
-rlibrary require the library before executing your script
But that doesn't let me reference my testing bootstrap script