File: sub-test-result.rb

package info (click to toggle)
ruby-test-unit 3.7.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,348 kB
  • sloc: ruby: 16,403; makefile: 9
file content (59 lines) | stat: -rw-r--r-- 1,212 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#--
#
# Author:: Tsutomu Katsube.
# Copyright:: Copyright (c) 2024 Tsutomu Katsube. All rights reserved.
# License:: Ruby license.

module Test
  module Unit
    class SubTestResult
      attr_accessor :stop_tag

      def initialize(parent_test_result)
        @parent_test_result = parent_test_result
        @stop_tag = nil
      end

      def add_run(result=self)
        @parent_test_result.add_run(result)
      end

      def add_pass
        @parent_test_result.add_pass
      end

      # Records an individual assertion.
      def add_assertion
        @parent_test_result.add_assertion
      end

      def add_error(error)
        @parent_test_result.add_error(error)
      end

      def add_failure(failure)
        @parent_test_result.add_failure(failure)
      end

      def add_pending(pending)
        @parent_test_result.add_pending(pending)
      end

      def add_omission(omission)
        @parent_test_result.add_omission(omission)
      end

      def add_notification(notification)
        @parent_test_result.add_notification(notification)
      end

      def passed?
        @parent_test_result.passed?
      end

      def stop
        throw @stop_tag
      end
    end
  end
end