Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #99 from arthurnn/show_command

fix show command
  • Loading branch information...
commit 5c714dae23f63dce81401c1af483b8f9b31e8503 2 parents a3c8887 + b3d0dd9
@cldwalker authored
Showing with 9 additions and 2 deletions.
  1. +2 −2 lib/ruby-debug/commands/show.rb
  2. +7 −0 test/show_test.rb
View
4 lib/ruby-debug/commands/show.rb
@@ -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]+/)
View
7 test/show_test.rb
@@ -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'
Please sign in to comment.
Something went wrong with that request. Please try again.