diff --git a/lib/pry/default_commands/ls.rb b/lib/pry/default_commands/ls.rb index 3daa7f40..0409342a 100644 --- a/lib/pry/default_commands/ls.rb +++ b/lib/pry/default_commands/ls.rb @@ -143,7 +143,7 @@ class Pry opt.on :h, "help", "Show help" end - next output.puts(opts) if opts.present?(:help) + next output.puts(opts.to_s) if opts.present?(:help) obj = args.empty? ? target_self : target.eval(args.join(" ")) diff --git a/test/test_default_commands/test_ls.rb b/test/test_default_commands/test_ls.rb index 3e269b58..427d1f9c 100644 --- a/test/test_default_commands/test_ls.rb +++ b/test/test_default_commands/test_ls.rb @@ -22,7 +22,13 @@ describe "ls" do end end - describe "methods" do + describe "help" do + it 'should show help with -h' do + mock_pry("ls -h").should =~ /Usage: ls/ + end + end + + describe "methods" do it "should show public methods by default" do mock_pry("ls Class.new{ def goo; end }.new").should =~ /goo/ end