New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make files ending with _test show up, even if they are in the test/units folder #77
Conversation
I'll accept, but you make it clear to me this really needs a more robust solution. If you have any ideas, please convey. |
These are the ideas I have:
I think figuring out the current project directory, and filtering based off of that is probably the strongest way, if we can get that to work (seems simpler than specific code for each of the test drivers). I'm happy to help implement the solution, if you know what we should go for. |
I like your conclusion. Feel free to work on it, or I'll have a go at it when I get back from 3-day trip. But the default should be filtered and a config option to not filter (I've had complaints about not filtering before). If memory serves, $DEBUG will already do this. Is that good enough, or do you think it should have specialized config? |
I think using the $DEBUG option as the only way to turn on or off filtering makes sense. Adding additional config options will only add complexity. What do you think about merging in this pull request, so it works by out of the box for people using rails conventions, and then also documenting the $RUBY_IGNORE_CALLERS variable in the README. That way if the same problem hits someone else, they will know where to look, and hopefully can help make smarter regexes over time as different people update it to support their edge cases. I think it's important to not filter out the test line for people using common ruby conventions though. |
Okay, we can do that. But could you make is also support files starting with 'test_' b/c that is what I usually do. Then I will merge, and we can go from there. |
Sure, that makes sense. I'll tweak the regex, push up the changes, and make another comment on the pull request so you'll get notified. I should get around to it in the next day or two. |
I just updated the pull request:
|
Make test_* and *_test files show up, even when in the test/units folder
Pulled, thanks! Btw, don't quite understand the trailing
wouldn't
be enough? |
Before the line of the test that was failing was being filtered out from the stacktrace if the test mode was unit. This was causing a stacktrace that was this:
to be filtered to this:
and not give what line of the test file the assertion or exception failed at. This was caused by the filter_backtrace method removing all the elements of the backtrace that are in the test/units directory (and not only the ones that were specific for rails infrastructure test directory like assertion.rb).
This change does the following:
Let me know if there are any changes that I need to make before getting this merged into master.