return boolean options set

This commit is contained in:
josh committed 2013-01-20 22:54:06 -05:00
1 parent 56e644e16e
commit 056257b8f5
2 files changed
+36 -4

No files matched your search

+14
View File
@@ -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