summaryrefslogtreecommitdiff
path: root/test/option_test.rb
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2014-11-19 07:53:58 +0000
committerLee Jarvis <ljjarvis@gmail.com>2014-11-19 07:53:58 +0000
commitb91db74b327848841bee30cbecead14c45e3a260 (patch)
treeaa1551027931886bed6237127ea0af588ab6ac86 /test/option_test.rb
parente78399b4841d709ccc02de14c583f92ef8a649ff (diff)
downloadslop-b91db74b327848841bee30cbecead14c45e3a260.tar.gz
Add Options#to_s help string
Diffstat (limited to 'test/option_test.rb')
-rw-r--r--test/option_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/option_test.rb b/test/option_test.rb
new file mode 100644
index 0000000..606264e
--- /dev/null
+++ b/test/option_test.rb
@@ -0,0 +1,14 @@
+require 'test_helper'
+
+describe Slop::Option do
+ def option(*args)
+ Slop::Option.new(*args)
+ end
+
+ describe "#flag" do
+ it "returns the flags joined by a comma" do
+ assert_equal "-f, --bar", option(%w(-f --bar), nil).flag
+ assert_equal "--bar", option(%w(--bar), nil).flag
+ end
+ end
+end