test_bench-session 2.0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/test_bench/session/controls/capture_sink/event.rb +9 -0
- data/lib/test_bench/session/controls/capture_sink/path.rb +30 -0
- data/lib/test_bench/session/controls/capture_sink/record.rb +19 -0
- data/lib/test_bench/session/controls/comment.rb +16 -0
- data/lib/test_bench/session/controls/detail.rb +16 -0
- data/lib/test_bench/session/controls/events/aborted.rb +29 -0
- data/lib/test_bench/session/controls/events/commented.rb +29 -0
- data/lib/test_bench/session/controls/events/context_finished.rb +32 -0
- data/lib/test_bench/session/controls/events/context_skipped.rb +29 -0
- data/lib/test_bench/session/controls/events/context_started.rb +29 -0
- data/lib/test_bench/session/controls/events/detailed.rb +29 -0
- data/lib/test_bench/session/controls/events/failed.rb +35 -0
- data/lib/test_bench/session/controls/events/file_finished.rb +32 -0
- data/lib/test_bench/session/controls/events/file_started.rb +29 -0
- data/lib/test_bench/session/controls/events/finished.rb +32 -0
- data/lib/test_bench/session/controls/events/fixture_finished.rb +32 -0
- data/lib/test_bench/session/controls/events/fixture_started.rb +29 -0
- data/lib/test_bench/session/controls/events/started.rb +29 -0
- data/lib/test_bench/session/controls/events/test_finished.rb +32 -0
- data/lib/test_bench/session/controls/events/test_skipped.rb +29 -0
- data/lib/test_bench/session/controls/events/test_started.rb +29 -0
- data/lib/test_bench/session/controls/events.rb +27 -0
- data/lib/test_bench/session/controls/exception.rb +27 -0
- data/lib/test_bench/session/controls/failure.rb +30 -0
- data/lib/test_bench/session/controls/file.rb +58 -0
- data/lib/test_bench/session/controls/fixture.rb +16 -0
- data/lib/test_bench/session/controls/process_id.rb +7 -0
- data/lib/test_bench/session/controls/random.rb +7 -0
- data/lib/test_bench/session/controls/result.rb +12 -0
- data/lib/test_bench/session/controls/time.rb +7 -0
- data/lib/test_bench/session/controls/title.rb +27 -0
- data/lib/test_bench/session/controls.rb +36 -0
- data/lib/test_bench/session/events.rb +32 -0
- data/lib/test_bench/session/session.rb +232 -0
- data/lib/test_bench/session/substitute.rb +93 -0
- data/lib/test_bench/session/telemetry/capture_sink/path.rb +65 -0
- data/lib/test_bench/session/telemetry/capture_sink/record.rb +39 -0
- data/lib/test_bench/session/telemetry/capture_sink.rb +63 -0
- data/lib/test_bench/session.rb +11 -0
- metadata +109 -0
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: f3250cb8c227d32f9895c3b6bc832177f1a9dff367ba88c92d575e662e785c39
         | 
| 4 | 
            +
              data.tar.gz: 5a6ed10dd0ea4aaa956e7bd13b521d7a88bf1ca87b6183270a6535d520de4a0d
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 4325057fc2cd623f68fc45db2e4dbdfed821bd6707059d800188c07223c758d6441646e09d620312d8b9ac6b0be1c43c5f15f592db0f490f0b1ba2c1d399ff36
         | 
| 7 | 
            +
              data.tar.gz: 9e35be1361eca6411038ff4ed8486fe18a67fd3a3ff1eff378c271ca2dacb57ef76d21ba939d75a569afd0b9f388f941787dd80352f801aa16b2a9fe2bb240bb
         | 
| @@ -0,0 +1,30 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module CaptureSink
         | 
| 5 | 
            +
                    module Path
         | 
| 6 | 
            +
                      def self.example(segments=nil)
         | 
| 7 | 
            +
                        segments ||= Segment.examples
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                        segments = segments.dup
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        path = TestBench::Session::Telemetry::CaptureSink::Path.new
         | 
| 12 | 
            +
                        path.segments = segments
         | 
| 13 | 
            +
                        path
         | 
| 14 | 
            +
                      end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                      module Segment
         | 
| 17 | 
            +
                        def self.examples
         | 
| 18 | 
            +
                          [example, Context.other_example, Test.example]
         | 
| 19 | 
            +
                        end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                        def self.example = Context.example
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                        Test = Title::Test
         | 
| 24 | 
            +
                        Context = Title::Context
         | 
| 25 | 
            +
                      end
         | 
| 26 | 
            +
                    end
         | 
| 27 | 
            +
                  end
         | 
| 28 | 
            +
                end
         | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
            end
         | 
| @@ -0,0 +1,19 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module CaptureSink
         | 
| 5 | 
            +
                    module Record
         | 
| 6 | 
            +
                      def self.example(event: nil, path: nil)
         | 
| 7 | 
            +
                        event ||= self.event
         | 
| 8 | 
            +
                        path ||= self.path
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                        TestBench::Session::Telemetry::CaptureSink::Record.new(event, path)
         | 
| 11 | 
            +
                      end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                      def self.event = Event.example
         | 
| 14 | 
            +
                      def self.path = Path.example
         | 
| 15 | 
            +
                    end
         | 
| 16 | 
            +
                  end
         | 
| 17 | 
            +
                end
         | 
| 18 | 
            +
              end
         | 
| 19 | 
            +
            end
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Comment
         | 
| 5 | 
            +
                    module Text
         | 
| 6 | 
            +
                      def self.example(suffix=nil)
         | 
| 7 | 
            +
                        suffix = " #{suffix}" if not suffix.nil?
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                        "Some comment#{suffix}"
         | 
| 10 | 
            +
                      end
         | 
| 11 | 
            +
                      def self.random = example(Random.string)
         | 
| 12 | 
            +
                    end
         | 
| 13 | 
            +
                  end
         | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
            end
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Detail
         | 
| 5 | 
            +
                    module Text
         | 
| 6 | 
            +
                      def self.example(suffix=nil)
         | 
| 7 | 
            +
                        suffix = " #{suffix}" if not suffix.nil?
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                        "Some detail#{suffix}"
         | 
| 10 | 
            +
                      end
         | 
| 11 | 
            +
                      def self.random = example(Random.string)
         | 
| 12 | 
            +
                    end
         | 
| 13 | 
            +
                  end
         | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module Aborted
         | 
| 6 | 
            +
                      def self.example(abort_process_id: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        abort_process_id ||= self.abort_process_id
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::Aborted.new(abort_process_id, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        abort_process_id = Random.integer
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(abort_process_id:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.abort_process_id = ProcessID.other
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module Commented
         | 
| 6 | 
            +
                      def self.example(text: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        text ||= self.text
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::Commented.new(text, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        text = Comment::Text.random
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(text:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.text = Comment::Text.example
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,32 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module ContextFinished
         | 
| 6 | 
            +
                      def self.example(title: nil, result: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        title ||= self.title
         | 
| 8 | 
            +
                        result = self.result if result.nil?
         | 
| 9 | 
            +
                        process_id ||= self.process_id
         | 
| 10 | 
            +
                        time ||= self.time
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                        Session::Events::ContextFinished.new(title, result, process_id, time)
         | 
| 13 | 
            +
                      end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                      def self.random
         | 
| 16 | 
            +
                        title = Title::Context.random
         | 
| 17 | 
            +
                        result = Result.random
         | 
| 18 | 
            +
                        process_id = ProcessID.random
         | 
| 19 | 
            +
                        time = Time.random
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                        example(title:, result:, process_id:, time:)
         | 
| 22 | 
            +
                      end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                      def self.title = Title::Context.example
         | 
| 25 | 
            +
                      def self.result = Result.example
         | 
| 26 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 27 | 
            +
                      def self.time = Time.example
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module ContextSkipped
         | 
| 6 | 
            +
                      def self.example(title: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        title ||= self.title
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::ContextSkipped.new(title, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        title = Title::Context.random
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(title:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.title = Title::Context.example
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module ContextStarted
         | 
| 6 | 
            +
                      def self.example(title: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        title ||= self.title
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::ContextStarted.new(title, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        title = Title::Context.random
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(title:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.title = Title::Context.example
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module Detailed
         | 
| 6 | 
            +
                      def self.example(text: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        text ||= self.text
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::Detailed.new(text, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        text = Detail::Text.random
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(text:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.text = Detail::Text.example
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,35 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module Failed
         | 
| 6 | 
            +
                      def self.example(message: nil, path: nil, line_number: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        message ||= self.message
         | 
| 8 | 
            +
                        path ||= self.path
         | 
| 9 | 
            +
                        line_number ||= self.line_number
         | 
| 10 | 
            +
                        process_id ||= self.process_id
         | 
| 11 | 
            +
                        time ||= self.time
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                        Session::Events::Failed.new(message, path, line_number, process_id, time)
         | 
| 14 | 
            +
                      end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                      def self.random
         | 
| 17 | 
            +
                        message = Failure::Message.random
         | 
| 18 | 
            +
                        path = Failure::Path.random
         | 
| 19 | 
            +
                        line_number = Failure::LineNumber.random
         | 
| 20 | 
            +
                        process_id = ProcessID.random
         | 
| 21 | 
            +
                        time = Time.random
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                        example(message:, path:, line_number:, process_id:, time:)
         | 
| 24 | 
            +
                      end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                      def self.message = Failure::Message.example
         | 
| 27 | 
            +
                      def self.path = Failure::Path.example
         | 
| 28 | 
            +
                      def self.line_number = Failure::LineNumber.example
         | 
| 29 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 30 | 
            +
                      def self.time = Time.example
         | 
| 31 | 
            +
                    end
         | 
| 32 | 
            +
                  end
         | 
| 33 | 
            +
                end
         | 
| 34 | 
            +
              end
         | 
| 35 | 
            +
            end
         | 
| @@ -0,0 +1,32 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module FileFinished
         | 
| 6 | 
            +
                      def self.example(path: nil, result: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        path ||= self.path
         | 
| 8 | 
            +
                        result ||= self.result
         | 
| 9 | 
            +
                        process_id ||= self.process_id
         | 
| 10 | 
            +
                        time ||= self.time
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                        Session::Events::FileFinished.new(path, result, process_id, time)
         | 
| 13 | 
            +
                      end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                      def self.random
         | 
| 16 | 
            +
                        path = File::Path.random
         | 
| 17 | 
            +
                        result = Result.random
         | 
| 18 | 
            +
                        process_id = ProcessID.random
         | 
| 19 | 
            +
                        time = Time.random
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                        example(path:, result:, process_id:, time:)
         | 
| 22 | 
            +
                      end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                      def self.path = File::Path.example
         | 
| 25 | 
            +
                      def self.result = Result.example
         | 
| 26 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 27 | 
            +
                      def self.time = Time.example
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module FileStarted
         | 
| 6 | 
            +
                      def self.example(path: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        path ||= self.path
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::FileStarted.new(path, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        path = File::Path.random
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(path:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.path = File::Path.example
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,32 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module Finished
         | 
| 6 | 
            +
                      def self.example(result: nil, process_count: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        result ||= self.result
         | 
| 8 | 
            +
                        process_count ||= self.process_count
         | 
| 9 | 
            +
                        process_id ||= self.process_id
         | 
| 10 | 
            +
                        time ||= self.time
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                        Session::Events::Finished.new(result, process_count, process_id, time)
         | 
| 13 | 
            +
                      end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                      def self.random
         | 
| 16 | 
            +
                        result = Result.random
         | 
| 17 | 
            +
                        process_count = Random.integer
         | 
| 18 | 
            +
                        process_id = ProcessID.random
         | 
| 19 | 
            +
                        time = Time.random
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                        example(result:, process_count:, process_id:, time:)
         | 
| 22 | 
            +
                      end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                      def self.result = Result.example
         | 
| 25 | 
            +
                      def self.process_count = Started.process_count
         | 
| 26 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 27 | 
            +
                      def self.time = Time.example
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
            end
         | 
| @@ -0,0 +1,32 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module FixtureFinished
         | 
| 6 | 
            +
                      def self.example(name: nil, result: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        name ||= self.name
         | 
| 8 | 
            +
                        result ||= self.result
         | 
| 9 | 
            +
                        process_id ||= self.process_id
         | 
| 10 | 
            +
                        time ||= self.time
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                        Session::Events::FixtureFinished.new(name, result, process_id, time)
         | 
| 13 | 
            +
                      end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                      def self.random
         | 
| 16 | 
            +
                        name = Fixture::Name.random
         | 
| 17 | 
            +
                        result = Result.random
         | 
| 18 | 
            +
                        process_id = ProcessID.random
         | 
| 19 | 
            +
                        time = Time.random
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                        example(name:, result:, process_id:, time:)
         | 
| 22 | 
            +
                      end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                      def self.name = Fixture::Name.example
         | 
| 25 | 
            +
                      def self.result = Result.example
         | 
| 26 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 27 | 
            +
                      def self.time = Time.example
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module FixtureStarted
         | 
| 6 | 
            +
                      def self.example(name: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        name ||= self.name
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::FixtureStarted.new(name, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        name = Fixture::Name.random
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(name:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.name = Fixture::Name.example
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module Started
         | 
| 6 | 
            +
                      def self.example(process_count: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        process_count ||= self.process_count
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::Started.new(process_count, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        process_count = Random.integer
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(process_count:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.process_count = 11
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,32 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module TestFinished
         | 
| 6 | 
            +
                      def self.example(title: nil, result: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        title ||= self.title
         | 
| 8 | 
            +
                        result = self.result if result.nil?
         | 
| 9 | 
            +
                        process_id ||= self.process_id
         | 
| 10 | 
            +
                        time ||= self.time
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                        Session::Events::TestFinished.new(title, result, process_id, time)
         | 
| 13 | 
            +
                      end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                      def self.random
         | 
| 16 | 
            +
                        title = Title::Test.random
         | 
| 17 | 
            +
                        result = Result.random
         | 
| 18 | 
            +
                        process_id = ProcessID.random
         | 
| 19 | 
            +
                        time = Time.random
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                        example(title:, result:, process_id:, time:)
         | 
| 22 | 
            +
                      end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                      def self.title = Title::Test.example
         | 
| 25 | 
            +
                      def self.result = Result.example
         | 
| 26 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 27 | 
            +
                      def self.time = Time.example
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module TestSkipped
         | 
| 6 | 
            +
                      def self.example(title: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        title ||= self.title
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::TestSkipped.new(title, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        title = Title::Test.random
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(title:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.title = Title::Test.example
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,29 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    module TestStarted
         | 
| 6 | 
            +
                      def self.example(title: nil, process_id: nil, time: nil)
         | 
| 7 | 
            +
                        title ||= self.title
         | 
| 8 | 
            +
                        process_id ||= self.process_id
         | 
| 9 | 
            +
                        time ||= self.time
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                        Session::Events::TestStarted.new(title, process_id, time)
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      def self.random
         | 
| 15 | 
            +
                        title = Title::Test.random
         | 
| 16 | 
            +
                        process_id = ProcessID.random
         | 
| 17 | 
            +
                        time = Time.random
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                        example(title:, process_id:, time:)
         | 
| 20 | 
            +
                      end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                      def self.title = Title::Test.example
         | 
| 23 | 
            +
                      def self.process_id = ProcessID.example
         | 
| 24 | 
            +
                      def self.time = Time.example
         | 
| 25 | 
            +
                    end
         | 
| 26 | 
            +
                  end
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
            end
         | 
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Events
         | 
| 5 | 
            +
                    def self.examples(random: nil)
         | 
| 6 | 
            +
                      random ||= false
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                      if random
         | 
| 9 | 
            +
                        method_name = :random
         | 
| 10 | 
            +
                      else
         | 
| 11 | 
            +
                        method_name = :example
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      controls = Session::Events.each_type.map do |event_type|
         | 
| 15 | 
            +
                        Events.const_get(event_type, false)
         | 
| 16 | 
            +
                      end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                      controls.map(&method_name)
         | 
| 19 | 
            +
                    end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                    def self.each_example(random: nil, &block)
         | 
| 22 | 
            +
                      examples(random:).each(&block)
         | 
| 23 | 
            +
                    end
         | 
| 24 | 
            +
                  end
         | 
| 25 | 
            +
                end
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
            end
         | 
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            module TestBench
         | 
| 2 | 
            +
              class Session
         | 
| 3 | 
            +
                module Controls
         | 
| 4 | 
            +
                  module Exception
         | 
| 5 | 
            +
                    def self.example(message=nil)
         | 
| 6 | 
            +
                      message ||= self.message
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                      Example.new(message)
         | 
| 9 | 
            +
                    end
         | 
| 10 | 
            +
                    def self.random = example(Message.random)
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                    def self.message = "Some message"
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                    module Message
         | 
| 15 | 
            +
                      def self.example(suffix=nil)
         | 
| 16 | 
            +
                        suffix = " #{suffix}" if not suffix.nil?
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                        "Some exception message#{suffix}"
         | 
| 19 | 
            +
                      end
         | 
| 20 | 
            +
                      def self.random = example(Controls::Random.string)
         | 
| 21 | 
            +
                    end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                    Example = Class.new(RuntimeError)
         | 
| 24 | 
            +
                  end
         | 
| 25 | 
            +
                end
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
            end
         |