Sha256: ddcba0718f02b120a924861c171e6d4086576ae712b7dce630bc87f7ee186cf3

Contents?: true

Size: 1.33 KB

Versions: 13

Compression:

Stored size: 1.33 KB

Contents

require_relative 'test_helper'

describe "Help Command" do
  include TestDsl
  include Columnize

  let(:available_commands) do
    Debugger::Command.commands.select(&:event).map(&:help_command).flatten.uniq.sort
  end

  it "must show help how to use 'help'" do
    temporary_change_hash_value(Debugger::HelpCommand.settings, :width, 50) do
      enter 'help'
      debug_file('help')
      check_output_includes(
        "Type 'help <command-name>' for help on a specific command",
        "Available commands:",
        columnize(available_commands, 50)
      )
    end
  end

  it "must show help when use shortcut" do
    enter 'h'
    debug_file('help')
    check_output_includes "Type 'help <command-name>' for help on a specific command"
  end

  it "must show an error if undefined command is specified" do
    enter 'help foobar'
    debug_file('help')
    check_output_includes 'Undefined command: "foobar".  Try "help".', interface.error_queue
  end

  it "must show a command's help" do
    enter 'help break'
    debug_file('help')
    check_output_includes Debugger::AddBreakpoint.help(nil).split("\n").map { |l| l.gsub(/^ +/, '') }.join("\n")
  end

  describe "Post Mortem" do
    it "must work in post-mortem mode" do
      enter 'cont', 'help'
      debug_file "post_mortem"
      check_output_includes "Available commands:"
    end
  end

end

Version data entries

13 entries across 12 versions & 3 rubygems

Version Path
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/debugger-1.6.8/test/help_test.rb
debugger-1.6.8 test/help_test.rb
debugger-1.6.7 test/help_test.rb
debugger-1.6.6 test/help_test.rb
debugger-1.6.5 test/help_test.rb
debugger-1.6.4 test/help_test.rb
debugger-1.6.3 test/help_test.rb
debugger-1.6.2 test/help_test.rb
candlepin-api-0.4.0 bundle/ruby/gems/debugger-1.6.1/test/help_test.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/debugger-1.6.1/test/help_test.rb
debugger-1.6.1 test/help_test.rb
debugger-1.6.0 test/help_test.rb
debugger-1.5.0 test/help_test.rb