summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsigurdsvela <sigurdbergsvela@gmail.com>2015-04-06 23:41:57 +0200
committersigurdsvela <sigurdbergsvela@gmail.com>2015-04-06 23:41:57 +0200
commit3c572378fa8dd437bfb323c9cab39f95ed9a5341 (patch)
treef4438d8830548113eb3de5ddeeac8af6f4c2a39c /test
parentd16fe87263bd7a3d8c86d2314c2db28afaac002e (diff)
downloadslop-3c572378fa8dd437bfb323c9cab39f95ed9a5341.tar.gz
Implement getFlags in MissingArgument
A function in MissingArgument that returns and array of all the flags that matches the option missing an argument
Diffstat (limited to 'test')
-rw-r--r--test/error_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/error_test.rb b/test/error_test.rb
index d6a5412..1bf1604 100644
--- a/test/error_test.rb
+++ b/test/error_test.rb
@@ -7,6 +7,13 @@ describe Slop::MissingArgument do
opts = Slop::Options.new
opts.string "-n", "--name"
assert_raises(Slop::MissingArgument) { opts.parse %w(--name) }
+
+ #Assert returns the argument question
+ begin
+ opts.parse %w(--name)
+ rescue Slop::MissingArgument => e
+ assert_equal(e.getFlags(), ["-n", "--name"])
+ end
end
it "does not raise when errors are suppressed" do