Testing a plugin: Having to require plugin files manuall

Plugins are normally loaded in the test environment, so there's something more subtle going on here.

To help understand what's going on, it might be worth your while adding a "puts 'loading my hash plugin" at the top of your init.rb, and noting whether or not (or indeed, when) it gets loaded.

Additionally, how are you running the plugin tests? Via "rake test:plugins"? However you are doing it, you need to be sure that the Rails environment is being loaded first. Try adding the following line to your plugin's "test/hash_test.rb" file:

  require File.join(File.dirname(__FILE__), "..", "..", "..", "test", "test_helper")

I might've got the number of ".."'s wrong there, but basically the idea is to load Rails' test/test_helper.rb file. This will then ensure that the Rails environment is loaded, and your plugin will get loaded as you'd expect.

HTH,