From 704ed971ac5701e81b5e711a4ebcc4f16010fe00 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 21 Jan 2013 16:13:55 -0500 Subject: [PATCH] test --opt=val syntax --- spec/yawpa_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/yawpa_spec.rb b/spec/yawpa_spec.rb index 12c80a2..8a50980 100644 --- a/spec/yawpa_spec.rb +++ b/spec/yawpa_spec.rb @@ -57,5 +57,15 @@ describe Yawpa do params = ['--opt', 'val'] expect { Yawpa.parse(params, options) }.to raise_error end + + it "uses --opt=val syntax for an option's value" do + options = { + opt: {nargs: 1}, + } + params = ['--opt=thevalue', 'arg'] + opts, args = Yawpa.parse(params, options) + opts[:opt].should eq('thevalue') + args.should eq(['arg']) + end end end