Testing your plugin code without running rails
Scenario: you need to write a test script that should run independently from Rails, to test that your plugin hangs together.
Of course, you can install RSpec or another test framework, create a test directory, and start gathering tests. And you should do that. But at first, you may want to just write a teeny little .rb script that will call some method in your plugin to give you a reality check that the thing is working. Yes, yes, that's not true TDD/BDD, but hey, we're not all perfect. So how to do that? Simple. If the script you want to run is in your plugin's root directory, just put this at the top:require 'rubygems' require 'activesupport' $LOAD_PATH << "lib" ActiveSupport::Dependencies.load_paths = $LOAD_PATHAnd bingo... you'll have all the railsy auto-loading goodness that you need to write the rest of the script.