summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2011-04-15 09:30:14 +0100
committerLee Jarvis <lee@jarvis.co>2011-04-15 09:30:14 +0100
commite355ba4eb8c10da8fdbd81c08f988ffe287bdefa (patch)
treeaaa427e0bc30f11295b74d05161e610f5eaba2e2
parentd611b41f0981d65d547a5f46e8f3930c7ad46544 (diff)
downloadslop-e355ba4eb8c10da8fdbd81c08f988ffe287bdefa.tar.gz
add test for command banners
-rw-r--r--test/slop_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb
index fb29ecb..ab8c366 100644
--- a/test/slop_test.rb
+++ b/test/slop_test.rb
@@ -352,4 +352,13 @@ class SlopTest < TestCase
desc = slop.commands[:foo].commands[:bar].commands[:baz].options[:f].description
assert_equal 'D:', desc
end
+
+ test 'commands with banners' do
+ slop = Slop.new do
+ command(:foo, :banner => 'bar') { }
+ command(:bar) { banner 'bar' }
+ end
+ assert_equal 'bar', slop.commands[:foo].banner
+ assert_equal 'bar', slop.commands[:bar].banner
+ end
end