~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to lib/runit/cui/testrunner.rb

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Author:: Nathaniel Talbott.
 
2
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
 
3
# License:: Ruby license.
 
4
 
 
5
require 'test/unit/ui/console/testrunner'
 
6
require 'runit/testresult'
 
7
 
 
8
module RUNIT
 
9
  module CUI
 
10
    class TestRunner < Test::Unit::UI::Console::TestRunner
 
11
      @@quiet_mode = false
 
12
      
 
13
      def self.run(suite)
 
14
        self.new().run(suite)
 
15
      end
 
16
      
 
17
      def initialize
 
18
        super nil
 
19
      end
 
20
      
 
21
      def run(suite, quiet_mode=@@quiet_mode)
 
22
        @suite = suite
 
23
        def @suite.suite
 
24
          self
 
25
        end
 
26
        @output_level = (quiet_mode ? Test::Unit::UI::PROGRESS_ONLY : Test::Unit::UI::VERBOSE)
 
27
        start
 
28
      end
 
29
      
 
30
      def create_mediator(suite)
 
31
        mediator = Test::Unit::UI::TestRunnerMediator.new(suite)
 
32
        class << mediator
 
33
          attr_writer :result_delegate
 
34
          def create_result
 
35
            return @result_delegate.create_result
 
36
          end
 
37
        end
 
38
        mediator.result_delegate = self
 
39
        return mediator
 
40
      end
 
41
      
 
42
      def create_result
 
43
        return RUNIT::TestResult.new
 
44
      end
 
45
      
 
46
      def self.quiet_mode=(boolean)
 
47
        @@quiet_mode = boolean
 
48
      end
 
49
    end
 
50
  end
 
51
end