File: processor_test.rb

package info (click to toggle)
ruby-pry-byebug 3.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 324 kB
  • sloc: ruby: 1,171; makefile: 4
file content (40 lines) | stat: -rw-r--r-- 917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true

require "test_helper"

#
# Tests for pry-byebug's processor.
#
class ProcessorTest < Minitest::Spec
  let(:output) { StringIO.new }

  describe "Initialization" do
    let(:input) { InputTester.new }

    describe "normally" do
      let(:source_file) { test_file("stepping") }

      before do
        redirect_pry_io(input, output) { load source_file }
      end

      after { clean_remove_const(:SteppingExample) }

      it "stops execution at the first line after binding.pry" do
        _(output.string).must_match(/\=>  8:/)
      end
    end

    describe "at the end of block/method call" do
      let(:source_file) { test_file("deep_stepping") }

      before do
        redirect_pry_io(input, output) { load source_file }
      end

      it "stops execution at the first line after binding.pry" do
        _(output.string).must_match(/\=>  9:/)
      end
    end
  end
end