From 2abb114aeeed3357ae69e902c8bd8a9720cc7449 Mon Sep 17 00:00:00 2001 From: Lee Jarvis Date: Thu, 14 Apr 2011 22:41:59 +0100 Subject: test for raising if a command exists already --- test/slop_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.1