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

http://github.com/agross/netopenspace · Ruby · 44 lines · 32 code · 11 blank · 1 comment · 1 complexity · dc0986b52ede22a1f094202303affa30 MD5 · raw file

  1. require 'rubygems'
  2. require 'minitest/unit'
  3. require 'flexmock/test_unit_integration'
  4. require 'minitest/autorun'
  5. require 'rake'
  6. require File.expand_path('../file_creation', __FILE__)
  7. require File.expand_path('../in_environment', __FILE__)
  8. class Rake::TestCase < MiniTest::Unit::TestCase
  9. include FlexMock::ArgumentTypes
  10. include FlexMock::MockContainer
  11. include InEnvironment
  12. include FileCreation
  13. include Rake::DSL
  14. class TaskManager
  15. include Rake::TaskManager
  16. end
  17. def setup
  18. @orig_PWD = Dir.pwd
  19. end
  20. def teardown
  21. flexmock_teardown
  22. Dir.chdir @orig_PWD
  23. end
  24. def ignore_deprecations
  25. Rake.application.options.ignore_deprecate = true
  26. yield
  27. ensure
  28. Rake.application.options.ignore_deprecate = false
  29. end
  30. end
  31. # workarounds for 1.8
  32. $" << 'test/helper.rb'
  33. Test::Unit.run = true if Test::Unit.respond_to? :run=