Set the environment variable to TEST when running the tests.

The rake file does this, but in case the test are run with a different test runner (or if the _spec files are run manually) then this might be helpful.  Tests are breaking otherwise.