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"
|
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(" "))
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue