PageRenderTime 25ms CodeModel.GetById 19ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/Ruby/lib/ruby/1.8/runit/testresult.rb

http://github.com/agross/netopenspace
Ruby | 44 lines | 39 code | 2 blank | 3 comment | 0 complexity | f4c8255c3df98eda7b5ba36985fa3d94 MD5 | raw file
 1# Author:: Nathaniel Talbott.
 2# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
 3# License:: Ruby license.
 4
 5require 'test/unit/testresult'
 6
 7module RUNIT
 8  class TestResult < Test::Unit::TestResult
 9    attr_reader(:errors, :failures)
10    def succeed?
11      return passed?
12    end
13    def failure_size
14      return failure_count
15    end
16    def run_asserts
17      return assertion_count
18    end
19    def error_size
20      return error_count
21    end
22    def run_tests
23      return run_count
24    end
25    def add_failure(failure)
26      def failure.at
27        return location
28      end
29      def failure.err
30        return message
31      end
32      super(failure)
33    end
34    def add_error(error)
35      def error.at
36        return location
37      end
38      def error.err
39        return exception
40      end
41      super(error)
42    end
43  end
44end