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:
parent
79b1641fec
commit
cb65c26b9e
2 changed files with 8 additions and 2 deletions
|
@ -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(" "))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue