test exception on not enough arguments to option

This commit is contained in:
josh committed 2013-01-21 16:12:34 -05:00
1 parent fc90798459
commit c7c21ca97e
1 file changed
+8
+8
View File
@@ -49,5 +49,13 @@ describe Yawpa do
opts[:opt].should eq(['val1', 'val2']) opts[:opt].should eq(['val1', 'val2'])
args.should eq([]) args.should eq([])
end 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
end end