summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2011-04-15 09:32:22 +0100
committerLee Jarvis <lee@jarvis.co>2011-04-15 09:32:22 +0100
commit049a7913337780cf0c37b9e8805faedf3cb13e73 (patch)
treefb9d8f1439d713fb80308d310b9c3be70efe937d
parent6c8ac08ca7772ee514877d233c1eb29f3648593a (diff)
downloadslop-049a7913337780cf0c37b9e8805faedf3cb13e73.tar.gz
remove commands tests from slop_test
-rw-r--r--test/slop_test.rb54
1 files changed, 0 insertions, 54 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb
index a719de0..afab0b8 100644
--- a/test/slop_test.rb
+++ b/test/slop_test.rb
@@ -305,58 +305,4 @@ class SlopTest < TestCase
slop = Slop.new { on :f, :foo, true }
assert_raises(Slop::MissingArgumentError) { slop.parse %w/-f --bar/ }
end
-
- test 'commands' do
- slop = Slop.new do
- command :foo do on :f, :foo, 'foo option' end
- command :bar do on :f, :foo; on :b, :bar, true end
- end
-
- slop.commands.each_value do |command|
- assert_kind_of Slop, command
- end
-
- assert 'foo option', slop.commands[:foo].options[:foo].description
-
- slop.parse %w/bar --bar baz/
- assert 'baz', slop.commands[:bar][:bar]
- 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
- end
- assert slop.commands[:foo].instance_variable_get(:@strict)
- end
-
- test 'commands setting options' do
- slop = Slop.new :strict => false do
- command :foo, :strict => true do end
- end
- assert slop.commands[:foo].instance_variable_get(:@strict)
- end
-
- test 'inception' do
- slop = Slop.new do
- command(:foo) { command(:bar) { command(:baz) { on :f, 'D:' } } }
- end
- 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