PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/main.rb

https://bitbucket.org/tagoh/prune
Ruby | 38 lines | 14 code | 8 blank | 16 comment | 5 complexity | 3c5b06f925ebab4992aa4460ff6eefcd MD5 | raw file
Possible License(s): GPL-2.0
  1. # main.rb
  2. # Copyright (C) 2009 Akira TAGOH
  3. # Authors:
  4. # Akira TAGOH <akira@tagoh.org>
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 59 Temple Place - Suite 330,
  16. # Boston, MA 02111-1307, USA.
  17. require 'rubygems'
  18. gem 'test-unit'
  19. require 'test/unit/testcase'
  20. require 'test/unit/ui/console/testrunner'
  21. suite = Test::Unit::TestSuite.new
  22. ObjectSpace.each_object(Class) do |klass|
  23. if klass.ancestors.include?(Test::Unit::TestCase) && klass != Test::Unit::TestCase then
  24. suite << klass.suite
  25. end
  26. end
  27. result = Test::Unit::UI::Console::TestRunner.run(suite)
  28. if result.failure_count > 0 || result.error_count > 0 then
  29. exit 1
  30. end