test-unit 2.4.2 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/test/unit/autorunner.rb +2 -1
- data/lib/test/unit/util/backtracefilter.rb +27 -16
- data/lib/test/unit/version.rb +1 -1
- metadata +4 -4
data/lib/test/unit/autorunner.rb
CHANGED
@@ -8,33 +8,44 @@ module Test
|
|
8
8
|
|
9
9
|
module_function
|
10
10
|
def filter_backtrace(backtrace, prefix=nil)
|
11
|
-
return ["No backtrace"] unless
|
11
|
+
return ["No backtrace"] unless backtrace
|
12
12
|
return backtrace if ENV["TEST_UNIT_ALL_BACKTRACE"]
|
13
|
-
|
14
|
-
|
13
|
+
|
14
|
+
if prefix
|
15
|
+
split_prefix = prefix.split(TESTUNIT_FILE_SEPARATORS)
|
15
16
|
else
|
16
|
-
TESTUNIT_PREFIX
|
17
|
+
split_prefix = TESTUNIT_PREFIX
|
18
|
+
end
|
19
|
+
test_unit_internal_p = lambda do |entry|
|
20
|
+
components = entry.split(TESTUNIT_FILE_SEPARATORS)
|
21
|
+
split_entry = components[0, split_prefix.size]
|
22
|
+
next false unless split_entry[0..-2] == split_prefix[0..-2]
|
23
|
+
split_entry[-1].sub(TESTUNIT_RB_FILE, '') == split_prefix[-1]
|
17
24
|
end
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
split_e[-1].sub(TESTUNIT_RB_FILE, '') == split_p[-1]
|
25
|
+
|
26
|
+
jruby_internal_p = lambda do |entry|
|
27
|
+
(/\Aorg\/jruby\// =~ entry) ? true : false
|
22
28
|
end
|
23
|
-
|
29
|
+
|
24
30
|
found_prefix = false
|
25
|
-
new_backtrace = backtrace.reverse.reject do |
|
26
|
-
if(
|
31
|
+
new_backtrace = backtrace.reverse.reject do |entry|
|
32
|
+
if test_unit_internal_p.call(entry)
|
27
33
|
found_prefix = true
|
28
34
|
true
|
29
|
-
elsif
|
30
|
-
|
35
|
+
elsif found_prefix
|
36
|
+
jruby_internal_p.call(entry)
|
31
37
|
else
|
32
38
|
true
|
33
39
|
end
|
34
40
|
end.reverse
|
35
|
-
|
36
|
-
|
37
|
-
|
41
|
+
|
42
|
+
if new_backtrace.empty?
|
43
|
+
new_backtrace = backtrace.reject do |entry|
|
44
|
+
test_unit_internal_p.call(entry) or jruby_internal_p.call(entry)
|
45
|
+
end
|
46
|
+
new_backtrace = backtrace if new_backtrace.empty?
|
47
|
+
end
|
48
|
+
new_backtrace
|
38
49
|
end
|
39
50
|
end
|
40
51
|
end
|
data/lib/test/unit/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 2.4.
|
9
|
+
- 3
|
10
|
+
version: 2.4.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kouhei Sutou
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-11
|
19
|
+
date: 2011-12-11 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|