Class: Test::Unit::Collector::Dir

Inherits:
Object
  • Object
show all
Defined in:
lib/rake/ruby182_test_unit_fix.rb

Overview

Local Rake override to fix bug in Ruby 0.8.2

Instance Method Summary collapse

Instance Method Details

#collect_file(name, suites, already_gathered) ⇒ Object

:nodoc:



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rake/ruby182_test_unit_fix.rb', line 12

def collect_file(name, suites, already_gathered) # :nodoc:
  dir = File.dirname(File.expand_path(name))
  $:.unshift(dir) unless $:.first == dir
  if @req
    @req.require(name)
  else
    require(name)
  end
  find_test_cases(already_gathered).each do |t|
    add_suite(suites, t.suite)
  end
ensure
  $:.delete_at $:.rindex(dir)
end