mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Update relevant tests in "command_spec.rb"
Make them use the new Slop syntax.
This commit is contained in:
parent
c38eb20776
commit
bebf91f558
1 changed files with 8 additions and 8 deletions
|
@ -241,12 +241,12 @@ describe "Pry::Command" do
|
||||||
it "should create subcommands" do
|
it "should create subcommands" do
|
||||||
cmd = @set.create_command 'mum', 'Your mum' do
|
cmd = @set.create_command 'mum', 'Your mum' do
|
||||||
def subcommands(cmd)
|
def subcommands(cmd)
|
||||||
cmd.on :yell
|
cmd.command :yell
|
||||||
end
|
end
|
||||||
|
|
||||||
def process
|
def process
|
||||||
opts.command?(:blahblah).should == false
|
opts.fetch_command(:blahblah).should == nil
|
||||||
opts.command?(:yell).should == true
|
opts.fetch_command(:yell).present?.should == true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -256,15 +256,15 @@ describe "Pry::Command" do
|
||||||
it "should create subcommand options" do
|
it "should create subcommand options" do
|
||||||
cmd = @set.create_command 'mum', 'Your mum' do
|
cmd = @set.create_command 'mum', 'Your mum' do
|
||||||
def subcommands(cmd)
|
def subcommands(cmd)
|
||||||
cmd.on :yell do |opt|
|
cmd.command :yell do
|
||||||
opt.on :p, :person
|
on :p, :person
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def process
|
def process
|
||||||
args.should == ['papa']
|
args.should == ['papa']
|
||||||
opts[:yell][:person].should == true
|
opts.fetch_command(:yell).present?.should == true
|
||||||
opts[:yell].present? :person
|
opts.fetch_command(:yell).person?.should == true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ describe "Pry::Command" do
|
||||||
end
|
end
|
||||||
|
|
||||||
def process
|
def process
|
||||||
opts.arguments.should == ['papa', 'sonny', 'daughter']
|
args.should == ['yell', 'papa', 'sonny', 'daughter']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue