test exception on not enough arguments to option

This commit is contained in:
Josh Holtrop 2013-01-21 16:12:34 -05:00
parent fc90798459
commit c7c21ca97e

View File

@ -49,5 +49,13 @@ describe Yawpa do
opts[:opt].should eq(['val1', 'val2'])
args.should eq([])
end
it "raises an exception when not enough arguments for an option are given" do
options = {
opt: {nargs: 2},
}
params = ['--opt', 'val']
expect { Yawpa.parse(params, options) }.to raise_error
end
end
end