Sha256: dd87e72912d4649c93c87f76dcfc4812c693562b0ad0ee29cd19f76223ba5145

Contents?: true

Size: 2 KB

Versions: 6543

Compression:

Stored size: 2 KB

Contents

module RSpec
  module Core
    module Bisect
      # @private
      ExampleSetDescriptor = Struct.new(:all_example_ids, :failed_example_ids)

      # @private
      class BisectFailedError < StandardError
        def self.for_failed_spec_run(spec_output)
          new("Failed to get results from the spec run. Spec run output:\n\n" +
              spec_output)
        end
      end

      # Wraps a `formatter` providing a simple means to notify it in place
      # of an `RSpec::Core::Reporter`, without involving configuration in
      # any way.
      # @private
      class Notifier
        def initialize(formatter)
          @formatter = formatter
        end

        def publish(event, *args)
          return unless @formatter.respond_to?(event)
          notification = Notifications::CustomNotification.for(*args)
          @formatter.__send__(event, notification)
        end
      end

      # Wraps a pipe to support sending objects between a child and
      # parent process. Where supported, encoding is explicitly
      # set to ensure binary data is able to pass from child to
      # parent.
      # @private
      class Channel
        if String.method_defined?(:encoding)
          MARSHAL_DUMP_ENCODING = Marshal.dump("").encoding
        end

        def initialize
          @read_io, @write_io = IO.pipe

          if defined?(MARSHAL_DUMP_ENCODING) && IO.method_defined?(:set_encoding)
            # Ensure the pipe can send any content produced by Marshal.dump
            @write_io.set_encoding MARSHAL_DUMP_ENCODING
          end
        end

        def send(message)
          packet = Marshal.dump(message)
          @write_io.write("#{packet.bytesize}\n#{packet}")
        end

        # rubocop:disable Security/MarshalLoad
        def receive
          packet_size = Integer(@read_io.gets)
          Marshal.load(@read_io.read(packet_size))
        end
        # rubocop:enable Security/MarshalLoad

        def close
          @read_io.close
          @write_io.close
        end
      end
    end
  end
end

Version data entries

6,543 entries across 6,542 versions & 38 rubygems

Version Path
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/rspec-core-3.11.0/lib/rspec/core/bisect/utilities.rb
cybrid_api_bank_ruby-0.123.12 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_organization_ruby-0.123.12 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_id_ruby-0.123.12 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_bank_ruby-0.123.11 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_organization_ruby-0.123.11 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_id_ruby-0.123.11 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_id_ruby-0.123.10 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_bank_ruby-0.123.10 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_organization_ruby-0.123.10 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_organization_ruby-0.123.7 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_id_ruby-0.123.7 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_bank_ruby-0.123.7 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
ory-client-1.15.12 vendor/bundle/ruby/3.1.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_bank_ruby-0.123.4 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_id_ruby-0.123.4 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_organization_ruby-0.123.4 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_bank_ruby-0.123.3 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_organization_ruby-0.123.3 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb
cybrid_api_id_ruby-0.123.3 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/bisect/utilities.rb