floehopper/mocha — pull request #40 by decitrig (2011-10-23 15:12:08+00:00)
Title: Exception raised when required out of order

I got bitten by the "must require mocha after test/unit" issue. The problem is that you get an error about mock() not being defined; so it's unclear what's going wrong. It was also mysterious because it would work when running as part of a Rake::TestTask, but not when running the file individually.

I added some code to raise an exception when mocha.rb is imported without a testing framework. I think it's more helpful this way; let me know if you want it handled in a different way.