/tools/Ruby/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/ruby182_test_unit_fix.rb

http://github.com/agross/netopenspace · Ruby · 25 lines · 21 code · 0 blank · 4 comment · 2 complexity · e4e450e4804adade342bb4a14110a850 MD5 · raw file

  1. # Local Rake override to fix bug in Ruby 0.8.2
  2. module Test # :nodoc:
  3. # Local Rake override to fix bug in Ruby 0.8.2
  4. module Unit # :nodoc:
  5. # Local Rake override to fix bug in Ruby 0.8.2
  6. module Collector # :nodoc:
  7. # Local Rake override to fix bug in Ruby 0.8.2
  8. class Dir # :nodoc:
  9. undef collect_file
  10. def collect_file(name, suites, already_gathered) # :nodoc:
  11. dir = File.dirname(File.expand_path(name))
  12. $:.unshift(dir) unless $:.first == dir
  13. if(@req)
  14. @req.require(name)
  15. else
  16. require(name)
  17. end
  18. find_test_cases(already_gathered).each{|t| add_suite(suites, t.suite)}
  19. ensure
  20. $:.delete_at $:.rindex(dir)
  21. end
  22. end
  23. end
  24. end
  25. end