File: testunit-test-util.rb

package info (click to toggle)
ruby-test-unit 2.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 772 kB
  • sloc: ruby: 11,397; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 453 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module TestUnitTestUtil
  private
  def jruby_only_test
    begin
      require "java"
    rescue LoadError
      omit("test for JRuby")
    end
  end

  def assert_fault_messages(expected, faults)
    assert_equal(expected, faults.collect {|fault| fault.message})
  end

  def _run_test(test_case, name)
    result = Test::Unit::TestResult.new
    test = test_case.new(name)
    yield(test) if block_given?
    test.run(result) {}
    result
  end
end