return argument value when nargs = 1
This commit is contained in:
1 parent
056257b8f5
commit
4a693ba1ea
2 files changed
+37
-8
No files matched your search
@@ -29,5 +29,15 @@ describe Yawpa do
|
||||
opts.include?(:three).should be_false
|
||||
args.should eq(['arg', 'arg2'])
|
||||
end
|
||||
|
||||
it "returns an option's value when nargs = 1" do
|
||||
options = {
|
||||
opt: {nargs: 1},
|
||||
}
|
||||
params = ['--opt', 'val', 'arg']
|
||||
opts, args = Yawpa.parse(params, options)
|
||||
opts[:opt].should eq('val')
|
||||
args.should eq(['arg'])
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user