File: runner_against_program_with_byebug_call_test.rb

package info (click to toggle)
ruby-byebug 11.1.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,252 kB
  • sloc: ruby: 8,835; ansic: 1,662; sh: 6; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 558 bytes parent folder | download | duplicates (3)
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
# frozen_string_literal: true

require_relative "test_helper"

module Byebug
  #
  # Tests standalone byebug when debugging a target program
  #
  class RunnerAgainstProgramWithByebugCallTest < TestCase
    def setup
      super

      example_file.write("require 'byebug'\nbyebug\nsleep 0")
      example_file.close
    end

    def test_run_with_a_script_to_debug
      stdout = run_program(
        [RbConfig.ruby, example_path],
        'puts "Program: #{$PROGRAM_NAME}"'
      )

      assert_match(/Program: #{example_path}/, stdout)
    end
  end
end