return boolean options set
This commit is contained in:
1 parent
56e644e16e
commit
056257b8f5
2 files changed
+36
-4
No files matched your search
@@ -15,5 +15,19 @@ describe Yawpa do
|
||||
params = ['one', '--option', 'two']
|
||||
expect { Yawpa.parse(params, options) }.to raise_error
|
||||
end
|
||||
|
||||
it "returns boolean options which are set" do
|
||||
options = {
|
||||
one: {},
|
||||
two: {},
|
||||
three: {},
|
||||
}
|
||||
params = ['--one', 'arg', '--two', 'arg2']
|
||||
opts, args = Yawpa.parse(params, options)
|
||||
opts.include?(:one).should be_true
|
||||
opts.include?(:two).should be_true
|
||||
opts.include?(:three).should be_false
|
||||
args.should eq(['arg', 'arg2'])
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user