Skip to content

Commit

Permalink
help should display debugger's help during irb:rdbg session
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Aug 23, 2023
1 parent 2ce7593 commit 8e52da5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/irb/statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def suppresses_echo?
end

def should_be_handled_by_debugger?
IRB::ExtendCommand::DebugCommand > @command_class
require_relative 'cmd/help'
IRB::ExtendCommand::DebugCommand > @command_class || IRB::ExtendCommand::Help == @command_class
end

def evaluable_code
Expand Down
14 changes: 14 additions & 0 deletions test/irb/test_debug_cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,20 @@ def bar
assert_include(output, "InputMethod: RelineInputMethod")
end

def test_help_command_is_delegated_to_the_debugger
write_ruby <<~'ruby'
binding.irb
ruby

output = run_ruby_file do
type "debug"
type "help"
type "continue"
end

assert_include(output, "### Frame control")
end

def test_input_is_evaluated_in_the_context_of_the_current_thread
write_ruby <<~'ruby'
current_thread = Thread.current
Expand Down

0 comments on commit 8e52da5

Please sign in to comment.