Sha256: 93e216fbd5d3fc63ed2e06929ad9f7956f9cecd2b73d5790e2299733ed518552

Contents?: true

Size: 1.17 KB

Versions: 17

Compression:

Stored size: 1.17 KB

Contents

class TestInterface < Byebug::Interface
  attr_reader :input_queue, :output_queue, :error_queue, :confirm_queue

  attr_accessor :command_queue, :histfile, :history_length, :history_save
  attr_accessor :readline_support, :restart_file, :test_block

  def initialize
    @input_queue = []
    @output_queue = []
    @error_queue = []
    @confirm_queue = []
    @command_queue = []
    @readline_support = false
  end

  def errmsg(*args)
    @error_queue << format(*args)
  end

  def read_command(*args)
    if @input_queue.empty?
      if test_block
        test_block.call
        self.test_block = nil
      end
    else
      result = @input_queue.shift
      result.is_a?(Proc) ? result.call : result
    end
  end

  def print(*args)
    @output_queue << format(*args)
  end

  def confirm(message)
    @confirm_queue << message
    read_command message
  end

  def readline_support?
    @readline_support
  end

  def finalize
  end

  def close
  end

  def inspect
    [
      "input_queue: #{input_queue.inspect}",
      "output_queue: #{output_queue.inspect}",
      "error_queue: #{error_queue.inspect}",
      "confirm_queue: #{confirm_queue.inspect}"
    ].join("\n")
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/byebug-2.7.0/test/support/test_interface.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/byebug-2.7.0/test/support/test_interface.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/byebug-2.7.0/test/support/test_interface.rb
byebug-2.7.0 test/support/test_interface.rb
byebug-2.6.0 test/support/test_interface.rb
byebug-2.5.0 test/support/test_interface.rb
byebug-2.4.1 test/support/test_interface.rb
byebug-2.4.0 test/support/test_interface.rb
byebug-2.3.1 test/support/test_interface.rb
byebug-2.3.0 test/support/test_interface.rb
byebug-2.2.2 test/support/test_interface.rb
byebug-2.2.1 test/support/test_interface.rb
byebug-2.2.0 test/support/test_interface.rb
byebug-2.1.1 test/support/test_interface.rb
byebug-2.1.0 test/support/test_interface.rb
byebug-2.0.0 test/support/test_interface.rb
byebug-1.8.2 test/support/test_interface.rb