Sha256: adfa61616b8f3441e2f8cf3f8a0ed803933c68c1671f0a49736e854d5e9470db

Contents?: true

Size: 913 Bytes

Versions: 2

Compression:

Stored size: 913 Bytes

Contents

require 'test_helper'

#
# Tests for pry-byebug's processor.
#
class ProcessorTest < Minitest::Spec
  before do
    Pry.color = false
    Pry.pager = false
    Pry.hooks = Pry::DEFAULT_HOOKS
  end

  describe 'Initialization' do
    let(:step_file) { test_file('stepping') }

    before do
      @input = InputTester.new
      @output = StringIO.new
      redirect_pry_io(@input, @output) { load step_file }
    end

    it 'stops execution at the first line after binding.pry' do
      @output.string.must_match(/\=>  6:/)
    end
  end

  describe 'Initialization at the end of block/method call' do
    let(:step_file) { test_file('deep_stepping') }

    before do
      @input, @output = InputTester.new, StringIO.new
      redirect_pry_io(@input, @output) { load step_file }
    end

    it 'stops execution at the first line after binding.pry' do
      @output.string.must_match(/\=> 7:/)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pry-byebug-3.0.1 test/processor_test.rb
pry-byebug-3.0.0 test/processor_test.rb