Skip to content

Commit

Permalink
Add exit and exit! command in rdbg mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Apr 17, 2024
1 parent 37d7d5e commit d522f83
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions test/irb/test_debugger_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,28 +244,46 @@ def test_catch
def test_exit
write_ruby <<~'RUBY'
binding.irb
puts "hello"
puts "he" + "llo"
RUBY

output = run_ruby_file do
type "next"
type "debug"
type "exit"
end

assert_match(/irb\(main\):001> next/, output)
assert_match(/irb:rdbg\(main\):002>/, output)
assert_match(/hello/, output)
end

def test_force_exit
write_ruby <<~'RUBY'
binding.irb
puts "he" + "llo"
RUBY

output = run_ruby_file do
type "debug"
type "exit!"
end

assert_match(/irb:rdbg\(main\):002>/, output)
assert_not_match(/hello/, output)
end

def test_quit
write_ruby <<~'RUBY'
binding.irb
puts "he" + "llo"
RUBY

output = run_ruby_file do
type "next"
type "debug"
type "quit!"
end

assert_match(/irb\(main\):001> next/, output)
assert_match(/irb:rdbg\(main\):002>/, output)
assert_not_match(/hello/, output)
end

def test_prompt_line_number_continues
Expand Down

0 comments on commit d522f83

Please sign in to comment.