1
0
Fork 0
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:
Kyrylo Silin 2013-01-14 17:10:21 +02:00
parent c38eb20776
commit bebf91f558

View file

@ -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