add test for strings as keys for option configuration

This commit is contained in:
Josh Holtrop 2013-01-21 21:21:51 -05:00
parent bf60247b50
commit 21d64600dc

View File

@ -87,5 +87,15 @@ describe Yawpa do
opts[:opt].should eq('val2') opts[:opt].should eq('val2')
args.should eq(['arg1', 'arg2']) args.should eq(['arg1', 'arg2'])
end end
it "accepts strings as keys for option configuration" do
options = {
'crazy-option' => {nargs: 1},
}
params = ['xxx', '--crazy-option', 'yyy', 'zzz']
opts, args = Yawpa.parse(params, options)
opts['crazy-option'].should eq('yyy')
args.should eq(['xxx', 'zzz'])
end
end end
end end