Update relevant tests in "command_spec.rb"

Make them use the new Slop syntax.
This commit is contained in:
Kyrylo Silin 2013-01-14 17:10:21 +02:00
parent c38eb20776
commit bebf91f558
1 changed files with 8 additions and 8 deletions

View File

@ -241,12 +241,12 @@ describe "Pry::Command" do
it "should create subcommands" do
cmd = @set.create_command 'mum', 'Your mum' do
def subcommands(cmd)
cmd.on :yell
cmd.command :yell
end
def process
opts.command?(:blahblah).should == false
opts.command?(:yell).should == true
opts.fetch_command(:blahblah).should == nil
opts.fetch_command(:yell).present?.should == true
end
end
@ -256,15 +256,15 @@ describe "Pry::Command" do
it "should create subcommand options" do
cmd = @set.create_command 'mum', 'Your mum' do
def subcommands(cmd)
cmd.on :yell do |opt|
opt.on :p, :person
cmd.command :yell do
on :p, :person
end
end
def process
args.should == ['papa']
opts[:yell][:person].should == true
opts[:yell].present? :person
opts.fetch_command(:yell).present?.should == true
opts.fetch_command(:yell).person?.should == true
end
end
@ -278,7 +278,7 @@ describe "Pry::Command" do
end
def process
opts.arguments.should == ['papa', 'sonny', 'daughter']
args.should == ['yell', 'papa', 'sonny', 'daughter']
end
end