Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make files ending with _test show up, even if they are in the test/un…
…its folder
- Loading branch information
1 parent
7e21d9a
commit 287780f
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require File.expand_path(File.dirname(__FILE__)) + '/helper.rb' | ||
require File.expand_path(File.dirname(__FILE__) + '/..') + '/lib/turn/reporter' | ||
|
||
class TestReporter < Turn::Reporter | ||
end | ||
|
||
class TestReporters < Test::Unit::TestCase | ||
def test_unit_test_files_are_filtered_but_project_files_are_not | ||
reporter = TestReporter.new(nil) | ||
|
||
# If you follow the convention of naming your test files with _test.rb, do not filter that | ||
# test file from the stack trace | ||
filtered_lines = ["/Users/testman/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit/assertions.rb:185:in `assert_equal'"] | ||
unfiltered_lines = ["/Users/testman/source/campaign_manager/test/unit/omg_test.rb:145:in `block in <class:OmgTest>'", | ||
"/Users/testman/source/campaign_manager/app/models/omg.rb:145:in `in double_rainbows'" ] | ||
stack_trace = filtered_lines + unfiltered_lines | ||
|
||
assert_equal unfiltered_lines, reporter.send(:filter_backtrace, stack_trace) | ||
end | ||
end |