diff --git a/spec/yawpa_spec.rb b/spec/yawpa_spec.rb index 8a50980..18dc016 100644 --- a/spec/yawpa_spec.rb +++ b/spec/yawpa_spec.rb @@ -67,5 +67,15 @@ describe Yawpa do opts[:opt].should eq('thevalue') args.should eq(['arg']) end + + it "uses --opt=val for the first option argument when nargs > 1" do + options = { + opt: {nargs: 2}, + } + params = ['--opt=val1', 'val2', 'arg'] + opts, args = Yawpa.parse(params, options) + opts[:opt].should eq(['val1', 'val2']) + args.should eq(['arg']) + end end end