summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2011-04-14 22:41:59 +0100
committerLee Jarvis <lee@jarvis.co>2011-04-14 22:41:59 +0100
commit2abb114aeeed3357ae69e902c8bd8a9720cc7449 (patch)
treea5adcf86fbcbd1b6d56eb8030d20cc23f3040af4
parent96792eba8ccaff2f4f5c286be4269faa127df1d1 (diff)
downloadslop-2abb114aeeed3357ae69e902c8bd8a9720cc7449.tar.gz
test for raising if a command exists already
-rw-r--r--test/slop_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb
index e43aa3d..e9478d9 100644
--- a/test/slop_test.rb
+++ b/test/slop_test.rb
@@ -322,6 +322,12 @@ class SlopTest < TestCase
assert_nil slop.commands['bar']
end
+ test 'repeating existing commands' do
+ slop = Slop.new
+ slop.command :foo
+ assert_raises(ArgumentError) { slop.command :foo }
+ end
+
test 'commands inheriting options' do
slop = Slop.new :strict do
command :foo do end