…main. This closes #2
The backtrace was getting overly stripped because rails assumed all tests are in the "test" directoy. This fixes this by removing the backtrace silencer when in the test environment. We might consider allowing silencing of backtrace in libraries to make it more like Rails' default behavior. But I have always found that annoying. We are debugging when we are running tests so having the full backtrace is necessary. Also fork running the tests so we are sure it is happening in isolation.
When generating test names (required by Test::Unit) we used to generate a random name (if one not provided). In case of clashes (common if providing a name) it also added a 5 digit number to the end of every name. Later we found it useful to include the file and line number of the test into the name. This made the randomization and the 5 digit number unnecessary. This commit removes that making the output much cleaner and reducing the amount of code in this library.
Rails annoyingly loads all helpers for any subclass of ActionController::Base. This includes the TestController used by ActionView::TestCase. So basically our helpers are loaded just by loading Rails test stuff. Our solution is to use 'load' instead of 'require'. This means that some files will load more than once but it means we can capture the tests even though Rails has already loaded our helpers. We already had code in place to prevent the test from registering more than once. The only downside is a file may not be designed to be reloadable (i.e. it might set some constant so we will start getting warnings, etc). I think we are just going to have to cross that bridge when we come to it. With the way things were the helper tests were not getting run at all.
Thanks to Vikrant Chaudhary for helping me come up with a MUCH better way of switching to the test environment. For more info see: http://stackoverflow.com/questions/4349916/automatically-run-gem-tasks-in-test-environment
We still do not want to support < Rails 3 for actually using this library. But if there is an 2.3.x Rails app that is using a library that is using test_inline we want that library to be loadable.
… once. Also updated Rakefile to have test task again.
included in repo.