1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

fixed ls -h and added test

This commit is contained in:
John Mair 2011-12-17 18:57:42 +13:00
parent 79b1641fec
commit cb65c26b9e
2 changed files with 8 additions and 2 deletions

View file

@ -143,7 +143,7 @@ class Pry
opt.on :h, "help", "Show help" opt.on :h, "help", "Show help"
end 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(" ")) obj = args.empty? ? target_self : target.eval(args.join(" "))

View file

@ -22,7 +22,13 @@ describe "ls" do
end end
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 it "should show public methods by default" do
mock_pry("ls Class.new{ def goo; end }.new").should =~ /goo/ mock_pry("ls Class.new{ def goo; end }.new").should =~ /goo/
end end