Sha256: 50c28ad5eedfff21e65bd8179d772130c3d4a3282dec71740fdd6db454a7f416

Contents?: true

Size: 1.54 KB

Versions: 348

Compression:

Stored size: 1.54 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.
      # @private
      class Channel
        def initialize
          @read_io, @write_io = IO.pipe
        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

348 entries across 285 versions & 55 rubygems

Version Path
primary_connect_proto-0.7.0 vendor/bundle/ruby/2.6.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
svix-0.53.1 vendor/bundle/ruby/2.7.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
svix-0.53.0 vendor/bundle/ruby/2.7.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
primary_connect_proto-0.6.0 vendor/bundle/ruby/2.6.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/rspec-core-3.10.0/lib/rspec/core/bisect/utilities.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/rspec-core-3.10.0/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha58 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha57 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha56 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha55 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha54 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha53 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha52 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha51 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha50 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha49 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha48 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha47 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha46 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb
ory-client-0.0.1.alpha45 vendor/bundle/ruby/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/bisect/utilities.rb