summaryrefslogtreecommitdiff
path: root/test/option_test.rb
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2011-11-04 19:04:31 -0700
committerLee Jarvis <lee@jarvis.co>2011-11-04 19:04:31 -0700
commit18fcb3f03148656e76e808fd744e597bebfa3871 (patch)
tree827cb5f467af7085e07b564c91fc21d015859b80 /test/option_test.rb
parent05e97091fd01910409e513bae968357b053ffb64 (diff)
downloadslop-18fcb3f03148656e76e808fd744e597bebfa3871.tar.gz
allow foo= long flag options for options which accept an argument
Diffstat (limited to 'test/option_test.rb')
-rw-r--r--test/option_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/option_test.rb b/test/option_test.rb
index d7eec0e..ef8633e 100644
--- a/test/option_test.rb
+++ b/test/option_test.rb
@@ -25,6 +25,11 @@ class OptionTest < TestCase
refute option(:f, :foo).expects_argument?
end
+ test 'expects an argument if long option is suffixed with =' do
+ assert option(:f, :foo=).expects_argument?
+ assert option('f', 'foo=').expects_argument?
+ end
+
test 'accepts an optional argument if optional is true' do
assert option(:f, :optional => true).accepts_optional_argument?
assert option(:f, false, :optional => true).accepts_optional_argument?