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.
@@ -143,7 +143,8 @@ module Test
143
143
  end
144
144
  end
145
145
 
146
- def process_args(args = ARGV)
146
+ def process_args(args=ARGV)
147
+ args = args.dup
147
148
  begin
148
149
  args.unshift(*@default_arguments)
149
150
  options.order!(args) {|arg| @to_run << arg}
@@ -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(backtrace)
11
+ return ["No backtrace"] unless backtrace
12
12
  return backtrace if ENV["TEST_UNIT_ALL_BACKTRACE"]
13
- split_p = if(prefix)
14
- prefix.split(TESTUNIT_FILE_SEPARATORS)
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
- match = proc do |e|
19
- split_e = e.split(TESTUNIT_FILE_SEPARATORS)[0, split_p.size]
20
- next false unless(split_e[0..-2] == split_p[0..-2])
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
- return backtrace unless(backtrace.detect(&match))
29
+
24
30
  found_prefix = false
25
- new_backtrace = backtrace.reverse.reject do |e|
26
- if(match[e])
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(found_prefix)
30
- false
35
+ elsif found_prefix
36
+ jruby_internal_p.call(entry)
31
37
  else
32
38
  true
33
39
  end
34
40
  end.reverse
35
- new_backtrace = (new_backtrace.empty? ? backtrace : new_backtrace)
36
- new_backtrace = new_backtrace.reject(&match)
37
- new_backtrace.empty? ? backtrace : new_backtrace
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
@@ -1,5 +1,5 @@
1
1
  module Test
2
2
  module Unit
3
- VERSION = '2.4.2'
3
+ VERSION = '2.4.3'
4
4
  end
5
5
  end
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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 4
9
- - 2
10
- version: 2.4.2
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-26 00:00:00 Z
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