Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #99 from arthurnn/show_command
Browse files Browse the repository at this point in the history
fix show command
  • Loading branch information
cldwalker committed Sep 23, 2013
2 parents a3c8887 + b3d0dd9 commit 5c714da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ruby-debug/commands/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def regexp
end

def execute
if not @match[1]
subcommands = subcmd.map { |s| "show #{s.name} -- #{s.short_help}" }.join("\n")
if !@match[1]
subcommands = Subcommands.map { |s| "show #{s.name} -- #{s.short_help}" }.join("\n")
print pr("show.errors.no_subcommand", subcommands: subcommands)
else
args = @match[1].split(/[ \t]+/)
Expand Down
7 changes: 7 additions & 0 deletions test/show_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
describe "args" do
temporary_change_hash_value(Debugger::Command.settings, :argv, %w{foo bar})

it "when no args givenmust show args" do
Debugger.send(:remove_const, "RDEBUG_SCRIPT") if Debugger.const_defined?("RDEBUG_SCRIPT")
enter 'show'
debug_file 'show'
check_output_includes /\"show\" must be followed by the name of an show command/
end

it "must show args" do
Debugger.send(:remove_const, "RDEBUG_SCRIPT") if Debugger.const_defined?("RDEBUG_SCRIPT")
enter 'show args'
Expand Down

0 comments on commit 5c714da

Please sign in to comment.